【发布时间】:2010-08-29 05:24:01
【问题描述】:
我正在制作一个 facebook 应用程序并使用 stream.publish 在墙上分享一些东西。
但是对于 1) attachemnt 链接和 2) FB UI 操作链接,当我单击其中任何一个时,它将在同一浏览器窗口中加载页面。
我想以某种方式在这些链接中添加诸如 target="_blank" 之类的内容,以便它在新选项卡中打开链接。 我知道这是可能的,因为当我在 youtube 上分享视频时,它的操作链接和分享链接上有一个 target="_blank"。
有人知道诀窍吗?
我试过这样的代码(我插入了目标空白),但它没有在超链接中添加目标元素:
FB.ui(
{
method: 'stream.publish',
message: 'Check out this great app! http://apps.facebook.com/{your_app}',
attachment:
{
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'),
'media': [{
'type': 'image',
'target': '_blank',
'src': 'http://test3.com/test.png',
'href': 'http://test3.com'}],
href: 'http://test2.com',
target: '_blank'
},
action_links: [
{ text: 'Code', href: 'http://github.com/facebook/connect-js' }
],
user_message_prompt: 'Share your thoughts about Connect',
target: '_blank'
}
);
有谁知道 youtube 如何实现目标
【问题讨论】:
标签: facebook