私はOpen Graph APIを使用して "Facebookでログイン"を実装しようとしています。これまでのところFF、Chrome、Safariで動作しますが、IEでは動作しません。 IE9でのテスト。Facebook API、FacebookでのログインがIEでのみ動作しない
IEでは、Facebookのダイアログボックスにログインします。私は正常にFacebookにログインできますが、何も起こりません。他のブラウザでは、ページがリダイレクトされ、fbユーザデータがデータベースに保存されます。
私はFB doctypesを別々に試してみましたが、運がありません。
xmlns:fb="http://ogp.me/ns/fb#"
xmlns:fb="http://www.facebook.com/2008/fbml"
編集:テスト用のアラートボックスを含めるだけで、FB.apiのものを削除しました。 IE以外のすべてで動作します。
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo $AppID; ?>',
channelUrl : '//www.mysite.net/channel.php', // Channel File
oauth : true,
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
function fb_login(){
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
//console.log(response); // dump complete info
access_token = response.authResponse.accessToken; //get access token
user_id = response.authResponse.userID; //get FB UID
FB.api('/me', function(response) {
alert(response.id);
});
} else {
//user hit cancel button
console.log('User cancelled login or did not fully authorize.');
}
}, {
scope: 'email,publish_actions'
}
);
}
// 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));
</script>
重要:テストするIEのバージョンを指定してください。 – Spudley
リマインダをありがとう... IE9を使用しています。 – user1373779