How can I force Facebook's stream.publish dialog to always open in a new tab or window?
I have a link with this listener:
$('#share-via-facebook-trigger').click(function () {
FB.ui(
{
method: 'stream.publish',
attachment: {
name: "<%= "name" %>",
caption: 'caption',
description: "<%=开发者_开发百科 "desc" %>",
message: "some message ",
href: "some href "
},
action_links: [
{ text: "<%= "text" %>", href: "some url" }
]
},
function(response) {
if (response && response.post_id) {
//alert('Post was published.');
} else {
//alert('Post was not published.');
}
}
);
})
If the user isn't logged in to facebook, the link opens in a new window. If the user is logged in to facebook, a dialog opens next to the link right on the page and it get clipped and looks very ugly. How can I make sure the dialog always opens in a new window?
I've tried adding a target="_blank" attribute to the link, but the problem remains. I'd appreciate any help.
You can perform the same with plain url like this one. So all you need is just to create a link with target="_blank"
and such URL.
Comprehensive list of parameters and theirs values you can find in documentation
精彩评论