Home >Web Front-end >JS Tutorial >js closes the browser window and checks the browser closing event_javascript skills

js closes the browser window and checks the browser closing event_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:23:391868browse
js closes the browser window

js closes the browser window without popping up the prompt box. Supports ie6, Firefox, Google and other browsers.
Copy code The code is as follows:




logout< ;/a>



Firefox does not support js to close the browser window by default. You can change dom.allow_scripts_to_close_windows in about:config is true.

js checks the browser closing event

js checks the browser closing or refreshing event and actively pops up a prompt box. Supports ie6, Firefox, Google and other browsers.
Copy code The code is as follows:






Statement:
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