<body>
<div id="fb-root"></div>
<script>
// This js didnt work, update the reload href further down !!! var currentUrl = 'https://www.facebook.com/pages/Mosquito-Digital/186527884694190?id=186527884694190&sk=app_629434517084781';
var likesPage = false;
var addisPageId = 'xxxxxxxxx'; //got this from http://graph.facebook.com/pagename
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : 'xxxxxxxxxxx', // App ID from the app dashboard
channelUrl : '//myurl.com/channel.html', // Channel file for x-domain comms
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me/likes?fields=id', function(response) {
for (var i=0;i<response.data.length;i++) {
if(response.data[i].id == addisPageId) {
likesPage = true;
break;
}
}
if(likesPage) {
window.location = '/continuepage.aspx';
//document.getElementById("likePage").style.display = "inline";
} else {
document.getElementById("container_notlike").style.display = "inline";
}
});
} else {
window.parent.location = "https://www.facebook.com/xxxxx";
//document.getElementById("nologin").style.display = "inline";
}
}, {scope: 'user_likes'});
// Additional initialization code such as adding Event Listeners goes here
};
// Load the SDK asynchronously
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_gb/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div id="container_notlike">
<img src="/xxxxx/like-page-01.jpg" />
</div>
<div id="container_like">
</div>
</body>
答案 0 :(得分:3)
检查您的移动版Safari是否有&#34;阻止弹出窗口&#34;活性。如果它被激活,FB.login将无法正常工作而没有任何响应/提示/错误/无论如何。
Instruction如何停用Mobile Safari上的弹出窗口阻止程序。