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

后端 未结 4 1793
情话喂你
情话喂你 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:39

    I had this happening to me as well on safari and found this post but found another solution I wanted to add with lots of browser support. Instead of replacing the current location use the method that is on the location object called assign()

    document.location.assign(document.location.origin + "/user_home.html")
    

    This also works

    location.assign(location.origin + "/user_home.html")
    

    Tested in Chrome and safari on desktop and mobile iOS devices

    reference: https://www.w3schools.com/jsref/met_loc_assign.asp

提交回复
热议问题