I want to capture the browser close event in my application and show a confirm box to user. I am using JSF 2.0 and richfaces 4.0.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
Attach a handler to the
unload
event.onbeforeunload
Example :
Use the
beforeunload
event.Keep in mind this will be fire for other events besides closing the window, such as reloading and form submission.