【问题标题】:Stream publishing in Facebook ConnectFacebook Connect 中的流式发布
【发布时间】:2010-01-21 18:59:54
【问题描述】:

我想在外部 Facebook Connect 网站上发布信息流。

这应该通过我已经包含的 JavaScript 客户端库来完成。

我的页面代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="de" lang="de">
<head>
[...]
</head>
<body>
[...]
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/de_DE" type="text/javascript"></script>
<script type="text/javascript">
FB.init("XYZ", "xd_receiver.htm");
FB.Connect.ifUserConnected(set_cookies_and_refresh());
</script>
[...]
<script type="text/javascript">
var addedLinks = [{ "text": "Challenge XYZ now", "href": "http://example.org/page1.html" }];
FB.Connect.streamPublish("", null, addedLinks, null, "What do you want to add?");
</script>
[...]
</body>
</html>

页面加载后应立即打开流对话。

怎么了?你能帮助我吗?非常感谢!

【问题讨论】:

    标签: javascript api facebook


    【解决方案1】:

    您需要先ensure that the Connect library has loaded 才能尝试使用它。

    FB.ensureInit(function() {
      // do something here
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-19
      • 1970-01-01
      相关资源
      最近更新 更多