Facebook登录onlogin回调触发了两次

Ana*_*and 6 facebook facebook-like facebook-javascript-sdk

我想在网站上整合facebook登录.使用的代码:

<fb:login-button autologoutlink="true" scope="read_stream,publish_stream,offline_access,email,user_birthday,status_update,user_status,user_hometown,user_location" onlogin="checkFBLoginStatus();">Sign in with Facebook</fb:login-button>
Run Code Online (Sandbox Code Playgroud)

当用户已登录到Facebook并单击此代码生成的按钮时,onlogin中指定的功能甚至会被触发两次.

在fbinit我有

        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true,  // parse XFBML
        oauth: true
Run Code Online (Sandbox Code Playgroud)

和函数checkFBLoginStatus只包含一个警告语句