//如果是多线程浏览器,则弹出IE,根据无忧脚本——钟钟的代码修改而来
function noBorderWin() {
contents="<body bgcolor=red><font color=white>多线程浏览器测试</font></body>"
pop=window.open("","_blank","width=200,height=100");
pop.document.writeln(contents);
if(pop.document.body.clientWidth!=200||pop.document.body.clientHeight!=100)
//如果不是纯粹的IE窗口中
{
window.showModalDialog("about:<"+"script language=javascript> pop2=window.open('index.asp','nbw_v6','fullscreen=no,menubar=yes,location=yes,toolbar=yes,status=yes,width='+(screen.width-10)+',height='+(screen.height-178)+',scrollbars=yes'); window.close();"+"</"+"script>","","dialogWidth:0px;dialogHeight:0px");
pop.close();
document.write("<font color=blue><b style='font-size:14px;'>请不要使用多线程浏览器,将自动打开IE,为了不影响您使用本浏览器浏览其他站点,请手工关闭此页面!</b></font>");
window.close();
}
else
pop.close()
}

解决方案 »

  1.   

    这样比较好
    function openwin(){
    var w=780,h=540;
    var tempWin=window.showModelessDialog("temp.htm");
    var pop=tempWin.open("http://www.163.com","163","resizable=0");
    pop.resizeTo(w,h);
    pop.moveTo(Math.ceil((window.screen.width-w)/2),Math.ceil((window.screen.height-h)/2));
    pop.focus();
    }
    其中temp.htm
    里面是这样
    <body onload=window.close()>
      

  2.   

    如果是不顾忌sp1问题
    可以这样
    function openwin(){
    var w=780,h=540;
    var tempWin=window.showModelessDialog("about:<onload onload=window.close()>");
    var pop=tempWin.open("http://www.163.com","163","resizable=0");
    pop.resizeTo(w,h);
    pop.moveTo(Math.ceil((window.screen.width-w)/2),Math.ceil((window.screen.height-h)/2));
    pop.focus();
    }