location.href="login.html"
I found that it does not jump immediately after executing this statement, but after all the JS statements following the statement are executed, the jump is performed. Why?
淡淡烟草味2017-06-28 09:30:41
The assignment of
window.location.href
will not interrupt the execution of Javascript. So it’s best to add a statement like return
at the end to end it
ringa_lee2017-06-28 09:30:41
If you need to jump directly without executing the following, you can add return false;
after the jumpPHP中文网2017-06-28 09:30:41
No, I tested it and it didn’t happen. It jumps immediately. You can post your code and see if it has anything to do with your code, such as whether it is in an asynchronous function