亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

js關(guān)閉瀏覽器窗口及檢查瀏覽器關(guān)閉事件

 更新時(shí)間:2013年09月03日 16:19:33   作者:  
js關(guān)閉瀏覽器窗口,不彈出提示框。支持ie6+,火狐,谷歌等瀏覽器,下面以一個(gè)示例為大家詳細(xì)介紹下具體的實(shí)現(xiàn)方法,感興趣的朋友可以參考下
js關(guān)閉瀏覽器窗口

js關(guān)閉瀏覽器窗口,不彈出提示框。支持ie6+,火狐,谷歌等瀏覽器。
復(fù)制代碼 代碼如下:

<html>
<head />
<body>
<script type="text/javascript">
function closeWin(){
window.opener=null;
window.open('','_self','');
window.close();
}
</script>
<a onclick="closeWin()" href="#">logout</a>
</body>
</html>

火狐默認(rèn)不支持js關(guān)閉瀏覽器窗口,可以在about:config中將dom.allow_scripts_to_close_windows改為true。

js檢查瀏覽器關(guān)閉事件

js檢查瀏覽器關(guān)閉或刷新事件,主動(dòng)彈出提示框。支持ie6+,火狐,谷歌等瀏覽器。
復(fù)制代碼 代碼如下:

<html>
<head />
<body>
<script type="text/javascript">
window.onbeforeunload = function(){
return "quit?";
}
</script>
</body>
</html>

相關(guān)文章

最新評(píng)論