![](/img/trans.png)
[英]How can I force Facebook's stream.publish dialog to always open in a new tab or window?
[英]Facebook's new Javascript SDK stream.publish broken?
使用FB.ui({方法:'stream.publish'...})它无法接受我的附件媒体,抱怨它应该是一个数组(虽然是数组)。
旧的API(FB.Connect.streamPublish)接受的格式很好,所有其他选项似乎都有效。 我发现Facebook文档太乱了,有人将其与新版本一起使用吗?
整个帖子创建如下:
var attachment = {media: new Array({type:'image',
src:'http://xxxxxxx' + baseurl + 'img/facebook-share_big.png',
href:'http://xxxxxxx' + baseurl}),
name: 'xxxxxxx',
description: message,
href: 'http://xxxxxxx' + baseurl};
var action = [{text: 'xxxxxxx', href: 'http://xxxxxxx' + baseurl}];
FB.ui({
method: 'stream.publish',
message: 'xxxxxxx',
attachment: attachment,
action_links: action,
user_message_prompt: 'xxxxxxx'
});
看到这篇文章: http : //forum.developers.facebook.com/viewtopic.php?pid=237121#p237121
建议的解决方案是:
......
window.fbAsyncInit = function() {
FB.JSON.stringify = function (value) { return JSON.encode(value);};
FB.init({
......
它对我有用(FF中的Mootools,尚未检查其他浏览器)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.