开发者

Facebook JavaScript SDK. Problem with simple usage

I hava a Facebook Canvas Application and I need to use FQL in it. I try to use FQL by using the following code (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('tem开发者_如何学运维p').setTextValue('Second');

FB.api(
      {
          method: 'fql.query',
          query: 'SELECT name FROM profile WHERE id=me()'
      },
      function (response) {
          document.getElementById('temp').setTextValue(response[0]);
      }
    );
</script>

But it doesn't work! It makes an error after document.getElementById('temp').setTextValue('First');

What's wrong with this code?


I have solved this one. You can't use Facebook JavaScript SDK inside of FBML Canvas pages, it is possible only for iFrame Canvas pages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜