Well, this doens't work.
FB.Connect.showPermissionDialog("email,offline_access", function(perms) {
if (!perms) {
document.location.href='YouNeedToAuthorize.h开发者_如何学编程tml';
} else {
document.location.href='homePage.html';
}
});
FB.Connect is undefined
Try
this.FB.Connect.showPermissionDialog("email,offline_access", function(perms) {
if (!perms) {
document.location.href='YouNeedToAuthorize.html';
} else {
document.location.href='homePage.html';
}
});
Also make sure you have this towards the end of your page.
<div id="FB_HiddenIFrameContainer"
style="display:none; position:absolute; left:-100px;top:-100px; width:0; height: 0;">
<script
src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"
type="text/javascript"></script>
<script type="text/javascript">
FB_RequireFeatures(["CanvasUtil","XFBML"], function(){
FB.Facebook.init( "{{ API_KEY }}", "/fb/xd");
FB.XdComm.Server.init("/fb/xd");
FB.CanvasClient.startTimerToSizeToContent(); });
</script>
</div>
精彩评论