Why isnt [removed].href= not forwarding to page using Safari?

后端 未结 4 1794
情话喂你
情话喂你 2020-12-03 22:41

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

Once the user has been id

4条回答
  •  感动是毒
    2020-12-03 23:21

    When I stack to this problem, I made function what working well on any Safari and also all browsers including mobile browsers:

    function windowLocation(url){
        var X = setTimeout(function(){
            window.location.replace(url);
            return true;
        },300);
    
        if( window.location = url ){
            clearTimeout(X);
            return true;
        } else {
            if( window.location.href = url ){
                clearTimeout(X);
                return true;
            }else{
                clearTimeout(X);
                window.location.replace(url);
                return true;
            }
        }
        return false;
    };
    

    Is a bit "dirty" solution but give you ability to redirect your page in any case.

提交回复
热议问题