I'm having issue redirecting a webpage on all browsers. I created a custom page for a client about a year back on SHOPIFY
and now the redirect function no longer works.
I was originally using document.location.href = "/cart"
and all worked well. But I recieved a call from him today saying the page wont redirect anymore on his IPhone
.
I changed it to window.top.location.href
, this fixed it for most browsers except safari. I understand that the best way for this to work on all browsers is the document
version. But that seems to have been out dated this year.
setTimeout(function(){ document.location.href = '/cart';},1000);
Checking the user agent of the browser and if it's safari we can do a different tailored version of a redirect, just haven't found out how to do this on the new safari yet.
@stanislav seems to have the same issue from this link, I suspect we will start to see the number of people with this issue growing.
Why isnt window.location.href= not forwarding to page using Safari?
Thanks to all for the input and suggestions, hoping to get the resolved soon.