fb邀请不工作的朋友,即8

时间:2013-01-29 04:51:13

标签: php facebook internet-explorer-8

我使用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>

1 个答案:

答案 0 :(得分:0)

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

fb init会喜欢:

FB.init({
appId:'xxxxxxxxxxxxxx',
domain:'yourdomain.com',
cookie:true,
status:true,
xfbml:true
});