Javascript Facebook身份验证不再有效-不可用';t呈现登录按钮
我的Facebook身份验证突然停止工作。FB改变了什么吗?目前我正在使用FB Javascript SDK从localhost运行该站点。以下FB代码均不工作Javascript Facebook身份验证不再有效-不可用';t呈现登录按钮,javascript,facebook,facebook-javascript-sdk,Javascript,Facebook,Facebook Javascript Sdk,我的Facebook身份验证突然停止工作。FB改变了什么吗?目前我正在使用FB Javascript SDK从localhost运行该站点。以下FB代码均不工作 alert("got here"); window.fbAsyncInit = function () { alert("didn't get here"); FB.init({ appId: '102671026556892', // App ID //appId: '384834001576531', // Ap
alert("got here");
window.fbAsyncInit = function () {
alert("didn't get here");
FB.init({
appId: '102671026556892', // App ID
//appId: '384834001576531', // App ID
channelUrl: '//localhost/channel.html', // Channel File
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
FB.Event.subscribe('auth.authResponseChange', function (response) {
if (response.status === 'connected') {
// the user is logged in and has authenticated your
// app, and response.authResponse supplies
// the user's ID, a valid access token, a signed
// request, and the time the access token
// and signed request each expire
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
FB.api('/' + uid, function (user) {
if (user) {
loginUser(uid, user.email, user.name);
window.location = "/users/index.html";
}
});
// check an load DB
// TODO: Handle the access token
} else if (response.status === 'not_authorized') {
// the user is logged in to Facebook,
// but has not authenticated your app
} else {
// the user isn't logged in to Facebook.
}
});
};
alert("got here too");
// Load the SDK Asynchronously
(function (d) {
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) { return; }
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
alert("got here as well");
不在window.fbAsyninit中的警报显示正常。window.fbAsyninit中的一个不存在。它不会呈现登录按钮(下面的代码)
使用Facebook登录
非常感谢您的帮助。上周末一切都好了(您是否检查了浏览器的错误控制台?是的,错误控制台中没有任何内容。虽然我刚刚发现,它似乎在FF中工作,但在chrome中不工作!Grr…必须是我安装的扩展。。。
<!-- START of Facebook LOGIN BUTTON -->
<div id="fb-root"></div>
<div class="fb-login-button" data-show-faces="false" data-width="400" data-max-rows="1" data-size="medium" data-colorscheme="light" scope="user_about_me, email, read_stream, publish_actions">Login with Facebook</div>
<!-- END of Facebook LOGIN BUTTON -->