How to create popup window when browser close

白昼怎懂夜的黑 提交于 2019-11-28 00:35:33
Dr. Rajesh Rolen
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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!