我想在浏览器关闭或关闭标签时打开弹出窗口.
解决方法:
window.onUnLoad= function (evt) {
//your code goes here
window.open("yourpage/some link");
}
编辑注意:现在它将在浏览器的onUnload事件上调用.现在试试
尝试window.onclose事件:
https://developer.mozilla.org/en/DOM/window.onclose
How to capture the browser window close event?
参考文献:
http://dotnetacademy.blogspot.com/2010/09/call-function-in-javascript-before.html
在下面,你可以找到所有事件与javascript窗口的例子:
http://www.java2s.com/Tutorial/JavaScript/0380__Window/windowonUnLoad.htm