Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

document.location does not change the webpage in IE9?

I am trying to redirect to a different page in IE9 (9.0.3).

When I try to get/set document.location, or document.location.href, or window.location/window.location.href, I'm unable to do so. It fails without giving any errors.

I've tried to check whether the document and windows objects are set, and they are, so I have no idea why the location object is "missing".

I tried getting the document.URL and that works fine, but it's read-only.

Anyone know what the problem is or how to achieve this in a cross-browser way?

like image 953
dgivoni Avatar asked Dec 27 '22 10:12

dgivoni


1 Answers

I was also experiencing the same problem but found that adding

window.event.returnValue = false;

above line in the javascript before the redirection resolved the problem.

like image 172
denmark dinga Avatar answered Dec 31 '22 14:12

denmark dinga