0
的Facebook的Javascript SDK父母和彈出頁面都轉向了Facebook登錄頁面
我遇到了我的Facebook的Javascript SDK問題....它的工作,但。當你點擊登錄...將會有彈出窗口顯示在Facebook上簽名(這是好的)..問題是,當你登錄彈出登錄窗口不關閉它的股票那裏...第二個問題是,父頁面也重定向到Facebook登錄頁面..我該如何解決這個問題?順便說一句,我在軌道上使用紅寶石。
繼承人我facebook.js:
window.fbAsyncInit = function() {
FB.init({
appId : "XXXXXXXXXXXXXXXX", // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
$(function() {
$("#signin").click(function() {
FB.login(function(response, event) {
if (response.authResponse) {
$.cookie("user_id", response.authResponse.userID);
$.cookie("access_token", response.authResponse.accessToken);
window.location = "#{auth_facebook_callback_url}";
} else {
}
}, {scope: 'email,read_stream,publish_stream,offline_access'});
});
});
$(function() {
$("#signout").click(function(){
FB.getLoginStatus(function(response){
if(response.authResponse){
FB.logout();
}
});
});
});
};
// 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));
感謝提前:)