here is the script
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxx',
xfbml : true,
version : 'v2.1'
});
$.ajax({
url: 'save.php',
dataType: 'JSON',
method: 'POST',
data: {image_data: img_src, save2server: 'y'},
success: function(response){
FB.ui({
method: 'feed',
link: response.url,
}, function(r){
});
}
});
}
the ajax request is succesfully, and i hande it, but the dialog doesn't show up..any clue?
Are you including Facebook SDK script? If not, include it just after the opening the body tag:
<script>
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Good luck!
For anyone that has the same issue, here is the answer: https://stackoverflow.com/a/7666936/1756281
FB.login or FB.ui methods must be called on a user initiated action (click) in Safari for new window/popup/iframe to be rendered by FB.UIServer. If you try calling these methods on a network callback event it will be blocked and the exception you described will occur
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.