javascript redirect only works in IE after showing the IE dev console
I came across the weirdest bug. All i wanted to do is send a form using jquery and in the callback redirect the user to another page, like:
window.loca开发者_运维技巧tion.href = "index.php?p=admin";
Which from what i can find should work in all browsers.
And it does, except in IE8/9 where it only does that after i hit F12 to show the dev console! After that i need to close the browser for the redirect to NOT work again.
Anyone know why this happens and know a better way to redirect to another local page using javascript that works in IE without being affected by this crazy bug?
Are you using any of the console. functions? They aren't defined until showing the dev console and will stop the script from executing.
Have you tried?
window.location.replace("index.php?p=admin");
精彩评论