<strong>js关闭浏览器窗口</strong> <br><br>js关闭浏览器窗口,不弹出提示框。支持ie6+,火狐,谷歌等浏览器。 <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="7415" class="copybut" id="copybut7415" onclick="doCopy('code7415')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code7415"> <br> <br> </div> <br> <br><script type="text/javascript"> <BR>function closeWin(){ <BR>window.opener=null; <BR>window.open('','_self',''); <BR>window.close(); <BR>} <BR></script> <br><a onclick="closeWin()" href="#">logout</a> <br> <br> <br> <br>火狐默认不支持js关闭浏览器窗口,可以在about:config中将dom.allow_scripts_to_close_windows改为true。 <br><br><strong>js检查浏览器关闭事件</strong> <br><br>js检查浏览器关闭或刷新事件,主动弹出提示框。支持ie6+,火狐,谷歌等浏览器。 <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="99129" class="copybut" id="copybut99129" onclick="doCopy('code99129')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code99129"> <br> <br> </div> <br> <br><script type="text/javascript"> <BR>window.onbeforeunload = function(){ <BR>return "quit?"; <BR>} <BR></script> <br> <br> <br>