为什么不是window.location.href =无法使用Safari转发到页面? [英] Why isnt window.location.href= not forwarding to page using Safari?

查看:85
本文介绍了为什么不是window.location.href =无法使用Safari转发到页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站允许用户通过Fb按钮登录,我为此使用FB/Parse.com JDK

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

我已经看到

window.location.href =

window.location.href=

但是,找不到适合我的解决方案的修复程序.有人知道解决这个问题的方法吗?

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转发到页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆