[英]get facebook user id with javascript sdk. And using global?
[英]Facebook JavaScript SDK. Problem with simple usage
我有一個Facebook Canvas應用程序,需要在其中使用FQL。 我嘗試通過以下代碼使用FQL(Facebook JavaScript SDK)
Output-<span id='temp'></span>
<script type="text/javascript" src="Scripts/jquery-1.4.4.min.js"></script>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
document.getElementById('temp').setTextValue('First');
FB.init({ apiKey: 'my api key' });
document.getElementById('temp').setTextValue('Second');
FB.api(
{
method: 'fql.query',
query: 'SELECT name FROM profile WHERE id=me()'
},
function (response) {
document.getElementById('temp').setTextValue(response[0]);
}
);
</script>
但這不起作用! 在document.getElementById('temp')。setTextValue('First');之后產生錯誤。
此代碼有什么問題?
我已經解決了這個問題。 您不能在FBML Canvas頁面內使用Facebook JavaScript SDK,這僅適用於iFrame Canvas頁面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.