0
我目前正在開發一個Facebook應用程序的畫布的過程中,所遇到的,我不能似乎與IE8/7和JS SDKFacebook的JS SDK在IE 8/7發出
我要解決問題試圖測試用戶的當前狀態,例如連接,未經授權。這在Chrome,Firefox中運行良好,但似乎並未在IE中觸發。這是我的Facebook JS代碼
window.fbAsyncInit = function() {
FB.init({
appId: 'xxxxxxxxxxxx',
channelUrl : '//www.mydomain.co.uk/channel.html', // Channel File
cookie: true,
xfbml: true,
oauth: true,
status: true
});
FB.getLoginStatus(function(response){
if (response.status === 'connected'){
alert('The status of the session is: ' + response.status);
$('a#remove-app').click(function(){
//var request = response.authResponse.accessToken;
//console.log(request);
$("#dialog:ui-dialog").dialog("destroy");
$("#dialog-confirm").dialog({
height:140,
modal: true,
position: [236,101],
buttons: {
"Yes": function() {
if(request){
$.ajax({
type: 'get',
dataType: 'jsonp',
url: 'https://graph.facebook.com/me/permissions',
data: 'method=delete&access_token=' + request,
success: function(response) {
top.location.href = 'http://facebook.com';
}
});
}
},
Cancel: function() {
$(this).dialog("close");
}
}
});
return false;
});
} else if(response.status === 'not_authorized') {
var oauth_url = 'https://www.facebook.com/dialog/oauth/';
oauth_url += '?client_id=xxxxxxxxx';
oauth_url += '&redirect_uri=' + encodeURIComponent('https://apps.facebook.com/kaplan-acca-news/');
oauth_url += '&scope=email'
window.top.location = oauth_url;
} else {
//alert('user not logged in');
var oauth_url = 'https://www.facebook.com/dialog/oauth/';
oauth_url += '?client_id=xxxxxxxx';
oauth_url += '&redirect_uri=' + encodeURIComponent('https://apps.facebook.com/kaplan-acca-news/');
oauth_url += '&scope=email'
window.top.location = oauth_url;
}
}, true);
$('a#invite-a-friend').click(function(){
sendRequestViaMultiFriendSelector();
});
// Multi friend selector for Facebook
function sendRequestViaMultiFriendSelector() {
FB.ui({method: 'apprequests',
message: 'Come and join the app on Facebook',
});
}
function requestCallback(response) {
alert(response);
}
};
// Load the SDK Asynchronously
(function() {
var e = document.createElement('script');
e.async = true;
e.src = '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
任何想法解決這個問題,我將不勝感激。
我已經通過JS Lint運行它,現在它可以在Windows 7上使用IE 8,但不能使用Windows XP,任何想法爲什麼它們在不同版本的Windows上運行方式不同? – James
他們可能出於兼容性原因。嘗試啓用/禁用IE7兼容模式。 –