How to create popup window when browser close
I want to o开发者_JAVA技巧pen popup window when browser closed or closed tabs.
window.onUnLoad= function (evt) {
//your code goes here
window.open("yourpage/some link");
}
EDIT NOTE: Now it will be called on onUnload event of browser. Try now
Try window.onclose event:
Capture event onclose browser
https://developer.mozilla.org/en/DOM/window.onclose
How to capture the browser window close event?
References:
http://dotnetacademy.blogspot.com/2010/09/call-function-in-javascript-before.html
On below like you can find all events with example of window for javascript:
http://www.java2s.com/Tutorial/JavaScript/0380__Window/windowonUnLoad.htm
精彩评论