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