1
使用the example from the developer site:FB.ui返回錯誤:元素未指定
FB.ui(
{
method: 'feed',
name: 'Facebook Dialogs',
link: 'https://developers.facebook.com/docs/reference/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.');
}
}
);
我得到以下回:
Error: element not specified
innerError: undefined
message: "element not specified"
起初我還以爲我失蹤了 「FB-根」 元素,但我有它在我的身體:
<body onLoad="onLoad()">
<div id="fb-root"></div>
</body>
現在我認爲它與我的Backbone/jQuery Mobile的用法有關,因爲正文第一頁加載後清除。然而,FB
對象被加載,所以我真的不知道什麼是錯的。任何想法試圖解決這個問題?
謝謝。
告訴我你不是用onLoad()函數做的嗎? – Gajotres 2013-03-15 17:57:41
你實際上是否包含SDK? – Igy 2013-03-15 18:18:21
不,這是在onLoad()之後。我在我的'
'中加載了一個js文件中的sdk,並設置了'window.fbAsyncInit'。 – Garrett 2013-03-15 22:19:08