站内搜索: 请输入搜索关键词

当前页面: 开发资料首页Javascript 专题JS捕捉网页浏览器窗口的关闭与刷新

JS捕捉网页浏览器窗口的关闭与刷新

摘要: JS捕捉网页浏览器窗口的关闭与刷新
<tr> <td> 运行代码框

<textarea class=fm id=code style="WIDTH: 512px; HEIGHT: 172px" rows=12 cols=81><script language="javascript"> var s="close"; function window.onunload(){ if(s=="fresh") if(window.screenLeft>10000){alert('关闭');}else{alert('刷新');} else alert('关闭'); } function window.onbeforeunload(){ s="fresh"; } </script></textarea>

<input style="CURSOR: hand" onfocus=this.blur() onclick="runEx('code')" type=button value=运行代码> <input style="WIDTH: 95px; CURSOR: hand" onfocus=this.blur() onclick=cycode(code) type=button value=复制到剪贴板 name=Submit> <input style="CURSOR: hand" onfocus=this.blur() onclick=svcode(code) type=button value=另存代码> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

我的测试环境是2000sever ie6.0+sp4 MYIE1.31 (成功通过测试)

关闭窗口的途径常用4种:
1.双击左上角图标
2.直接双击标题栏(MYIE)
3.单击右上角关闭按钮
4.alt+f4

题外话:
一天半的研究,不知道还有bug不?有的话,请高手补充,谢谢
希望解决问题一大遍

</td> </tr> </table>
↑返回目录
前一篇: Javascript实现小方框中浏览大图特效
后一篇: 预载入和JavaScript Image()对象