强制弹出窗口代码研究-又一款代码

作者: 来源: 日期:2009-10-19

(我在 IE8 中测试起作用,但在 Firefox 3.5 中被拦截。ITPOW编辑注)

<script language="JavaScript">
var paypopupURL = "http://www.codesky.net";
var randkey = '13'; //bypass IE functions
 
 
function setupActiveX(){
    document.write(' <INPUT ID="autoHit" TYPE="TEXT" ONKEYPRESS="showActiveX()">');
}
 
 
function openActiveX(){
    document.getElementById('autoHit').fireEvent("onkeypress",(document.createEventObject().keyCode=escape(randkey).substring(1)));
}
 
 
function showActiveX(){
    var newWindow=window.open(paypopupURL,'abcdefg','width=200,height=200,top=50,left='+(screen.width-250));
}
 
setupActiveX();
openActiveX();
self.focus();
</script>

相关文章