标签:
window.close()
window.open("about:blank","_self").close() 或者 window.open("","_self").close()
一般:window.top.close() 改善:window.open("about:blank","_top").close() 或者:window.open("","_top").close()
1 function closeWin() { 2 try { 3 window.opener = window; 4 var win = window.open("","_self"); 5 win.close(); 6 //frame的时候 7 top.close(); 8 } catch (e) { 9 10 } 11 }
1 function logout(){ 2 if(confirm("确定要退出吗?")){ 3 var browserName=navigator.appName; 4 if (browserName=="Netscape"){ 5 window.open(‘‘, ‘_self‘, ‘‘); 6 window.close(); 7 } 8 if (browserName=="Microsoft Internet Explorer") { 9 window.parent.opener = "whocares"; 10 window.parent.close(); 11 } 12 } 13 }
标签:
原文地址:http://www.cnblogs.com/Nightsky-Dec/p/5776584.html