在IE6中范例代码如下:
window.opener= null;
window.close();
在IE7中示例代码如下
window.opener= null;
window.open("","_self");
window.close();
如果要全屏显示(去掉IE的工具栏、地址栏和菜单栏等信息),则只能用window.open();的方法。如果第一个页面就要全屏显示,则需要设置一个中转页面。中转页面代码如下:(body中什么都不必写)
<head>
<title></title>
<script type="text/javascript" >
function openwindow() {
window.open('pos_search.htm', 'newwindow', 'fullScreen=1, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no');
window.opener = null;
window.open("", "_self");
window.close();
}
</script>
</head>
<body οnlοad="openwindow()">
</body>
</html>
function init2(){
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=b_version.split(";");
var trim_Version=version[1].replace(/[ ]/g,"");
if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0") {
alert("IE 6.0");
window.opener = null;
window.close();
window.open('<%=path%>/exam/logon2.jsp','_blank','fullscreen=yes,top=0,left=0,status=yes,menubar=no,scrollbars=yes,resizable=yes');
} else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") {
alert("IE 7.0");
window.open('<%=path%>/exam/logon2.jsp','_blank','fullscreen=yes,top=0,left=0,status=yes,menubar=no,scrollbars=yes,resizable=yes');
window.opener = null;
window.open("", "_self");
window.close();
} else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE8.0") {
alert("IE 8.0");
window.open('<%=path%>/exam/logon2.jsp','_blank','fullscreen=yes,top=0,left=0,status=yes,menubar=no,scrollbars=yes,resizable=yes');
window.opener = null;
window.open("", "_self");
window.close();
}
else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE9.0") {
alert("IE 9.0");
}
}