0

我使用 FB API 邀请朋友让用户邀请他们的朋友加入我的应用程序。在 Chrome 和 FF 中一切正常,但在 IE 8 中不行。当我点击它时,在 IE 的底部,将显示“页面错误”。错误将指向 connect.facebook.net 部分。下面是代码;

<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script src="https://connect.facebook.net/en_US/all.js"></script>

<script>
FB.init({
appId:'xxxxxxxxxxxxxx',
cookie:true,
status:true,
xfbml:true
});

function FacebookInviteFriends()
{
FB.ui({
method: 'apprequests',
message: 'Come Upload Your Own Photo For A Chance To WIN!',
  }, requestCallback);
}

function requestCallback(response)
{
if(response && response.request) {
     // Here, requests have been sent, facebook gives you the request and the array of     recipients
     //console.log(response);

     location.href='final.php';

} else {
alert("You need to invite friends in order to proceed");
     // No requests sent, you can do what you want 
}
}
</script>
4

1 回答 1

0

尝试在 FB.init 中添加域参数,它适用于 ie8

fb init 会喜欢:

FB.init({
appId:'xxxxxxxxxxxxxx',
domain:'yourdomain.com',
cookie:true,
status:true,
xfbml:true
});
于 2013-01-29T04:59:05.813 回答