还有一个问题,使用"window.close()"关闭窗口会有对话框弹出,有什么办法关闭窗口而不弹对话框吗?

解决方案 »

  1.   

    试试这个,可直接关闭 不用确认<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
    <input name=Button onClick=document.all.WebBrowser.ExecWB(45,1) type=button value=关闭窗口>
      

  2.   

    还有个更简单的,加个opener:<a href=javascript:window.opener=null;window.close()>Close</a>
      

  3.   

    你的需求是什么呢,
    没用过判断窗口的,只会判断body或text area上的焦点,你的窗口是指body吗?
    <body name="body">
    a
    <input type="text" name="a"><br>
    b<input type="text" name="b"><br>
    <input type="button" value="look" onmouseover="alert('焦点在'+document.activeElement.name+'上!')">
    </body>