アプリに対してユーザーを認証するために、google oauth2 javascript api を使用しています。これは Firefox と chrome では正常に機能しますが、IE では機能しません。IE 8、9、および 10 で試しましたが、無駄でした。私はネットでたくさん検索しましたが、それに対する解決策はありません。私はスタックオーバーフローの質問14285480と14830177を経験しました。これが Google の既存のバグである場合、これに代わる方法はありますか? 以下のコードを試しています。どの質問にもコメントするのに十分なスタックオーバーフローポイントがないので、新しい質問をします。助けてください。
これが私のコードです
<html>
<head>
<script type="text/javascript">
window.setTimeout(function() {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/client:plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
},1000)();
function signinCallback(authResult) {
if (authResult['access_token']) {
document.getElementById('signinButton').setAttribute('style', 'display: none');
}
else if (authResult['error']) {
console.log('Sign-in state: ' + authResult['error']);
}
}
</script>
</head>
<body>
<span id="signinButton">
<span
class="g-signin"
data-callback="signinCallback"
data-clientid="my clinetid"
data-cookiepolicy="single_host_origin"
data-requestvisibleactions="http://schemas.google.com/AddActivity"
data-scope="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile">
</span>
</span>
</body>
</html>