■test.htm:
<script>
window._open=window.open;
window.open=window_new_open;
function window_new_open( a,b,c )
{
var win;
if( c )
win=window._open( a,b,c );
else if( b )
win=window._open( a,b );
else
win=window._open( a );
if( win!=null&&!win.closed )
return win;
var option='status:0;help:0;dialogleft:10000px;dialogtop:10000px;dialogheight:0px;dialogwidth:0px';
win=showModalDialog( 'open.htm',[a,b,c],option );
return win;
}
</script>
<script>
var win=window.open( 'http://www.lostinet.com/' );
win.close( );
</script>
<body οnlοad="window_new_open(a,b,c)">
</body>
■open.htm:
<script>
function window.onload( )
{
var args=window.dialogArguments;
var a=args[0];
var b=args[1];
var c=args[2]
var win;
if( c )
win=window.open( a,b,c );
else if( b )
win=window.open( a,b );
else
win=window.open( a );
window.returnValue=win;
window.close( );
}
</script>
这个的好处就是不用改变已有的代码。只要想办法把这个代码放进原来的网页的前面把window.open替换掉就可以了。
DHTML 怎样防止IE工具对window.open的拦截
最新推荐文章于 2020-05-09 19:02:20 发布