Location.href problem in IE
October 19th, 2007 at 3:10pm |
Another case of something that seemed to always work and now all of a sudden doesn’t. I have a function loadSomething, that when clicked, does only:
location.href = ‘someurl.cfm’;
And it worked fine in FF but not in IE (6). So, after a few minutes of Googling I found out that you can solve the problem by adding
window.event.returnValue=false;
behind the redirect. Now it works in IE, too. Go figure!
Posted in Work
Hi,
Thank you very much, your trick worked. nice work. Thanks once again for solving my problem.
huh thanks man
ive been looking for this all day long :S
Hi its worked finally.
Thank you so much.
This trick is really amazing. Thank you very much.
THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thank you ! ^__^
In IE8, I have seen an intermittent “window.event is null” error. You have to add a check for “if (window.event != null)” before setting the returnValue to false.