问题描述
我的网站允许用户通过Fb按钮登录,我为此使用FB/Parse.com JDK https://parse.com/docs/js/guide#users-facebook-users
My site lets users login via the Fb button, I'm using the FB / Parse.com JDK for this https://parse.com/docs/js/guide#users-facebook-users
一旦识别出用户,下面的代码将使用户登录并将其转发到url上.在Chrome上可以正常使用,但在Safari上则无法使用,该页面仅停留在fb.html页面上,该页面为空白
Once the user has been identified, the below code logs the user in and forwards them onto a url. This works as expected under Chrome, but will not work using Safari, the page just stays on the fb.html page which is blank
我已经看到
但是,找不到适合我的解决方案的修复程序.有人知道解决这个问题的方法吗?
But, can't find a fix that works for my solution. Does anyone know a way around this?
Parse.FacebookUtils.logIn(null, {
success: function(user) {
if (!user.existed()) {
} else {
window.location.href="user_home.html";
}
},
error: function(user, error) {
}
});
推荐答案
在所有浏览器中的最佳工作方式:
Best way work in all browsers:
setTimeout(function(){document.location.href = "user_home.html";},250);
这篇关于为什么不是window.location.href =无法使用Safari转发到页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!