在不是js打開的頁面上按window.close(),會(huì)有提示框,很煩,現(xiàn)在可以不用了,沒有提示框直接關(guān)閉窗口。 以前有人貼過利用IE5.5/6.0漏洞做的無提示窗口,
<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"> 但后來ie6.0出了補(bǔ)丁,便失效了
現(xiàn)在有一種很簡(jiǎn)單的無提示關(guān)閉窗口代碼如下
:
<input type="button" onClick="window.opener = 'xxx';window.close();" value="IE6最簡(jiǎn)單的無提示關(guān)閉窗口" >
在不是js打開的頁面上按window.close(),會(huì)有提示框,很煩,現(xiàn)在可以不用了,沒有提示框直接關(guān)閉窗口。
試試下面代碼:
<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</object>
<input type="button" name="Button" value="關(guān)閉窗口" onClick="document.all.WebBrowser.ExecWB(45,1)">
試著改變參數(shù)會(huì)得到其他一些功能:
WebBrowser.ExecWB(1,1) 打開
WebBrowser.ExecWB(2,1) 關(guān)閉現(xiàn)在所有的IE窗口,并打開一個(gè)新窗口
WebBrowser.ExecWB(4,1) 保存網(wǎng)頁
WebBrowser.ExecWB(6,1) 打印
WebBrowser.ExecWB(7,1) 打印預(yù)覽
WebBrowser.ExecWB(8,1) 打印頁面設(shè)置
WebBrowser.ExecWB(10,1) 查看頁面屬性
WebBrowser.ExecWB(15,1) 好像是撤銷,有待確認(rèn)
WebBrowser.ExecWB(17,1) 全選
WebBrowser.ExecWB(22,1) 刷新
WebBrowser.ExecWB(45,1) 關(guān)閉窗體無提示
這些只對(duì)IE5.5以上版本有效,我是在IE6下測(cè)試的,通過的。
</object>
<input type="button" name="Button" value="關(guān)閉窗口" onClick="document.all.WebBrowser.ExecWB(45,1)">
如對(duì)本文有疑問,請(qǐng)?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會(huì)為你解答?。?點(diǎn)擊進(jìn)入論壇