当前位置: 代码迷 >> JavaScript >> IE,firefox(红狐)浏览器无提示关闭窗口js实现代码小结
  详细解决方案

IE,firefox(红狐)浏览器无提示关闭窗口js实现代码小结

热度:73   发布时间:2012-11-09 10:18:48.0
IE,firefox(火狐)浏览器无提示关闭窗口js实现代码小结
<script type="text/javascript"> function closeme(){ var browserName=navigator.appName; if (browserName=="Netscape") { window.open('','_parent',''); window.close(); } else if (browserName=="Microsoft Internet Explorer") { window.opener = "whocares"; window.close(); } } </script> <input type="button" value="close me 3" onclick="closeme();"/>


<script>
function CloseWin(){
window.opener=null;
window.open('','_self');
window.close();
}
</script>
<input type=button value="关闭" onclick="CloseWin()">

详细出处参考:http://www.jb51.net/article/20092.htm
  相关解决方案