它适用于Firefox,Chrome和IE,但没有在Safari上弹出,没有异常和错误。 在不同的机器上测试了几次狩猎。默认情况下Safari阻止弹出窗口。有没有办法自动解锁?
shareButton.on('click', function(e) {
// do something
shareAction();
}
function shareAction() {
// do something
share();
}
function share() {
// do something
submitShare();
}
function submitShare() {
// do something
// use the default fb.ui settings
FB.ui({
method: 'feed',
name: 'Facebook Dialogs',
link: 'https://developers.facebook.com/docs/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
}