Home > Web Front-end > JS Tutorial > body text

Methods to abort javascript execution_javascript tips

WBOY
Release: 2016-05-16 17:00:11
Original
1236 people have browsed it

JS does not have PHP’s exit, nor does JAVA’s return.

If the JS code is not a function and you need to abort JS execution, there is only one way, and that is:

document.location.href=your_url;

In addition, although throw can be terminated, it is still an unfriendly error message. Therefore, if you want to terminate it in a friendly manner, you can only use the above method.

Therefore, non-function mode code cannot stay on the current page to implement abort.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template