5

如果您注册一个 facebook 应用程序并使用 Heroku 的服务,它将为您生成一个示例应用程序,因为从几天前开始,发生无限循环并且您无法与您的应用程序交互。我试图替换 window.location = window.location; 与 window.top.location.href = “https://apps.facebook.com/xxxxxx”:

//Listen to the auth.login which will be called when the user logs in
//using the Login button
FB.Event.subscribe('auth.login', function(response) {
// We want to reload the page now so PHP can read the cookie that the
// Javascript SDK sat. But we don't want to use
// window.location.reload() because if this is in a canvas there was a
// post made to this page and a reload will trigger a message to the
// user asking if they want to send data again.
//window.location = window.location;
window.top.location.href = "https://apps.facebook.com/YOUR_APPs_NAMESPACE"
});

幸运的是,它解决了问题。这里只是分享。

4

0 回答 0