各位大哥:
我在网页中使用JS调用window.close()方法关闭当前窗口,可是浏览器会弹出对话框问是否要关闭。请问如何避免弹出这个对话框而直接关闭当前窗口呀?
---------------------------------------------------------------
多加一句代码:
window.opener = "meizz"; //IE5.5+
window.close();
---------------------------------------------------------------
<!-- IE5.5以上 -->
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
<input type=button value=打印 onclick="document.all.WebBrowser.ExecWB(6,1)">
<input type=button value=直接打印 onclick="document.all.WebBrowser.ExecWB(6,6)">
<input type=button value=页面设置 onclick="document.all.WebBrowser.ExecWB(8,1)">
<input type=button value=打印预览 onclick="document.all.WebBrowser.ExecWB(7,1)">
<input type=button value=打开 onclick="document.all.WebBrowser.ExecWB(1,1)">
<input type=button value=另存为 onclick="document.all.WebBrowser.ExecWB(4,1)">
<input type=button value=属性 onclick="document.all.WebBrowser.ExecWB(10,1)">
<input type=button value=全选 onclick="document.all.WebBrowser.ExecWB(17,1)">
<input type=button value=刷新 onclick="document.all.WebBrowser.ExecWB(22,1)">
<input type=button value=关闭窗口 onclick="document.all.WebBrowser.ExecWB(45,1)">
---------------------------------------------------------------
window.openner=null;
window.close();