Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.location Problem in IE

I have this simple code that is working fine in every browser, but NOT in IE (every version).

 window.setTimeout('window.location = \"http://www.domain/modules/yobilab/copyright/classes/GO_overview.php?refNumb=".$RefNumb."\"', 3000);
            return false;

In every browser it will go to the right link

In IE instead it includes also the Link where it comes from, so it will become something like this:

http://www.domain/PAGEWHEREIWAS/modules/yobilab/copyright/classes/GO_overview.php?refNumb=something

Why it is doing so?

It generates a NOT FOUND error obviously.

like image 344
DiegoP. Avatar asked Jul 12 '26 21:07

DiegoP.


2 Answers

Try using document.location instead of window.location.

like image 57
Teddy Avatar answered Jul 15 '26 10:07

Teddy


You need to create an anonymous function:

setTimeout(function() {window.location = "http://www.domain/modules/yobilab/copyright/classes/GO_overview.php?refNumb=12"}, 3000);
like image 38
Candide Avatar answered Jul 15 '26 11:07

Candide



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!