在属性列表之后“缺少}”在all.js文件的函数FB.subclass中

时间:2011-10-18 05:30:39

标签: facebook facebook-javascript-sdk

我想在FB Developer网站上做教程之后在Facebook上创建一个应用程序。我在使用Javascript SKD的步骤中得到了错误,我尝试使用此功能,这确实是错误的。

Error when using Javascript SDK


让我详细介绍一下我的应用程序:

以下是我的设置:

Summary             
App ID/API Key                              App Secret
xxxxxxxxxxxxxx                              xxxxxxxxxxxxxxxx

Canvas Page                                 Canvas URL
https://apps.facebook.com/ibattleship/      http://192.168.11.154:8091/

Secure Canvas URL                           Canvas FBML/iframe
https://192.168.11.154/                     iframe 

Contact Email                               Support Email
xxxxxxx@gmail.com                           xxxxxx@gmail.com

和index.php文件:

<html xmlns:fb="https://www.facebook.com/2008/fbml">
<body>
<div id="fb-root"></div>
<script>
    window.fbAsyncInit = function() {
        FB.init({
            appId      : '<?php echo APP_ID ?>', // App ID
            channelURL : '//192.168.11.154:8091/channel.html', // Channel File
            status     : true, // check login status
            cookie     : true, // enable cookies to allow the server to access the session
            oauth      : true, // enable OAuth 2.0
            xfbml      : true  // parse XFBML
        });     
    };

    // Load the SDK Asynchronously
    (function(d){
        var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        d.getElementsByTagName('head')[0].appendChild(js);
    }(document));
    // Additional initialization code here  
</script>
Hello, world.
</body>
</html>

channel.html文件

<?php
  $cache_expire = 60*60*24*365;
  header("Pragma: public");
  header("Cache-Control: maxage=".$cache_expire);
  header('Expires: '.gmdate('D, d M Y H:i:s', time()+$cache_expire).' GMT');
?>

<script src="//connect.facebook.net/en_US/all.js"></script>

但是,当我运行此页面时,我收到了上述错误。我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

这是来自Facebook Javascript SDK的错误。