简体   繁体   中英

Having problems using the FaceBook Javascript SDK cannot access UI

I am trying to use the facebook javascript SDK to bring up a simple application request window. However when I attempt to do so absolutely nothing happens.

Here is my code.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml">
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({
    appId  : '151092658309155',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true, // parse XFBML
    channelUrl : 'channel.html', // channel.html file
    oauth  : true // enable OAuth 2.0
  });
</script>

And then I call

<script>FB.ui({method: 'apprequests', message: 'You should learn more about this awesome game.', data: 'tracking information for the user'});</script>";

Can someone please explain what I am doing wrong?

You need to be running this page from a URL that has been authorized on the developer site . Facebook设置

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM