有时候当从一个窗口打开另一个窗口并关闭自身的时候,如何避免弹出确认的提示呢?

就是说在从一个窗口中打开一个新的窗口时,并关闭原来的窗口,用windows.close()时,时常会弹出一个确认是否关闭的提示,如何可以直接关掉而不出提示呢?
---------------------------------------------------------------

for IE5.5/6, try

window.opener=null;
window.close();

or you can try to add an object tag

1<object classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" height="0" id="hh" type="application/x-oleobject" width="0">
2<param name="Command" value="Close"/>
3</object>
1<input onclick="hh.HHClick()" type="button" value="close"/>

---------------------------------------------------------------

mywin=window.open(url);
window.opener=null;
window.close();
---------------------------------------------------------------

1<object classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="WebBrowser" width="0">
2</object>
1<input name="Button" onclick="document.all.WebBrowser.ExecWB(45,1)" type="button" value="关闭窗口"/>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus