Window.location called popup on safari

on a webpage I am trying to redirect the browser to another page on the same site. The code is very simple for this:

window.location = "/path1/path2" 

on safari - both windows, as well as mac - a message field containing only text

 "http://domain.com" 

.

I tried different ways to specify this: location.href, windows.assign (...) ... and all have the same behavior.

Have any of you seen this? and do you have a solution for this?

Thanks.

0
source share
3 answers

Thank you all for your help.

I found a problem. Before setting window.location somewhere in the call chain, one function will make an ajax request.

It seems that due to some changes, the query now takes longer than before. Therefore, if the location was changed during ajax req., A blank message box will appear.

Memi

0
source

look at the question . You should use:

 location.href = 'url'; 
+1
source

You must show the full code. For example, this bad code

 <a href="javascript:window.open()">Click</a> 

will show [OBJECT] when pressed.

If your script is just

 <script> window.location='someurl'; </script> 

then something else happens - I just checked it in Safari on my Mac

 <script> window.location='http://www.google.com' </script> 
0
source

All Articles