js不被IE拦截弹出窗口代码

js不被IE拦截弹出窗口代码

弹出网址改成自己要弹出的地址即可
   
   
   var paypopupURL = "http://www./弹出的网址.com";
   var usingActiveX = true;
   function blockError(){return true;}
   window.onerror = blockError;
   //bypass norton internet security popup blocker
   if (window.SymRealWinOpen){window.open = SymRealWinOpen;}
   if (window.NS_ActualOpen) {window.open = NS_ActualOpen;}
   if (typeof(usingClick) == ’undefined’) {var usingClick = false;}
   if (typeof(usingActiveX) == ’undefined’) {var usingActiveX = false;}
   if (typeof(popwin) == ’undefined’) {var popwin = null;}
   if (typeof(poped) == ’undefined’) {var poped = false;}
   if (typeof(paypopupURL) == ’undefined’) {var paypopupURL = "http://www./弹出的网址.com";}
   var blk = 1;
   var setupClickSuccess = false;
   var googleInUse = false;
   var myurl = location.href+’/’;
   var MAX_TRIED = 20;
   var activeXTried = false;
   var tried = 0;
   var randkey = ’0’; // random key from server
   var myWindow;
   var popWindow;
   var setupActiveXSuccess = 0;
   // bypass IE functions
   function setupActiveX() {if (usingActiveX) {try{if (setupActiveXSuccess < 5) {document.write(’’);popWindow=window.createPopup();popWindow.document.body.innerHTML=’
   ’;document.write(’’);popIframe.document.write(’’);setupActiveXSuccess = 6;}}catch(e){if (setupActiveXSuccess < 5) {setupActiveXSuccess++;setTimeout(’setupActiveX();’,500);}else if (setupActiveXSuccess == 5) {activeXTried = true;setupClick();}}}}
   function tryActiveX(){if (!activeXTried && !poped) {if (setupActiveXSuccess == 6 && googleInUse && popWindow && popWindow.document.getElementById(’getParentDiv’) && popWindow.document.getElementById(’getParentDiv’).object && popWindow.document.getElementById(’getParentDiv’).object.parentWindow) {myWindow=popWindow.document.getElementById(’getParentDiv’).object.parentWindow;}else if (setupActiveXSuccess == 6 && !googleInUse && popIframe && popIframe.getParentFrame && popIframe.getParentFrame.object && popIframe.getParentFrame.object.parentWindow){myWindow=popIframe.getParentFrame.object.parentWindow;popIframe.location.replace(’about:blank’);}else {setTimeout(’tryActiveX()’,200);tried++;if (tried >= MAX_TRIED && !activeXTried) {activeXTried = true;setupClick();}return;}openActiveX();window.windowFired=true;self.focus();}}
   function openActiveX(){if (!activeXTried && !poped) {if (myWindow && window.windowFired){window.windowFired=false;document.getElementById(’autoHit’).fireEvent("onkeypress",(document.createEventObject().keyCode=escape(randkey).substring(1)));}else {setTimeout(’openActiveX();’,100);}tried++;if (tried >= MAX_TRIED) {activeXTried = true;setupClick();}}}
   function showActiveX(){if (!activeXTried && !poped) {if (googleInUse) {window.daChildObject=popWindow.document.getElementById(’objectRemover’).children(0);window.daChildObject=popWindow.document.getElementById(’objectRemover’).removeChild(window.daChildObject);}newWindow=myWindow.open(paypopupURL,’abcdefg’);if (newWindow) {newWindow.blur();self.focus();activeXTried = true;poped = true;}else {if (!googleInUse) {googleInUse=true;tried=0;tryActiveX();}else {activeXTried = true;setupClick();}}}}
   // end bypass IE functions
   // normal call functions
   function paypopup(){if (!poped) {if(!usingClick && !usingActiveX) {popwin = window.open(paypopupURL,’abcdefg’);if (popwin) {poped = true;}self.focus();}}if (!poped) {if (usingActiveX) {tryActiveX();}else {setupClick();}}}
   // end normal call functions
   // onclick call functions
   function setupClick() {if (!poped && !setupClickSuccess){if (window.Event) document.captureEvents(Event.CLICK);prePaypopOnclick = document.onclick;document.onclick = gopop;self.focus();setupClickSuccess=true;}}
   function gopop() {if (!poped) {popwin = window.open(paypopupURL,’abcdefg’);if (popwin) {poped = true;}self.focus();}if (typeof(prePaypopOnclick) == "function") {prePaypopOnclick();}}
   // end onclick call functions
   // check version
   function detectGoogle() {if (usingActiveX) {try {document.write(’
   ’);googleInUse|=(typeof(document.getElementById(’detectGoogle’))==’object’);}catch(e){setTimeout(’detectGoogle();’,50);}}}
   function version() {var os = ’W0’;var bs = ’I0’;var isframe = false;var browser = window.navigator.userAgent;if (browser.indexOf(’Win’) != -1) {os = ’W1’;}if (browser.indexOf("SV1") != -1) {bs = ’I2’;}else if (browser.indexOf("Opera") != -1) {bs = "I0";}else if (browser.indexOf("Firefox") != -1) {bs = "I0";}else if (browser.indexOf("Microsoft") != -1 || browser.indexOf("MSIE") != -1) {bs = ’I1’;}if (top.location != this.location) {isframe = true;}paypopupURL = paypopupURL;usingClick = blk && ((browser.indexOf("SV1") != -1) || (browser.indexOf("Opera") != -1) || (browser.indexOf("Firefox") != -1));usingActiveX = blk && (browser.indexOf("SV1") != -1) && !(browser.indexOf("Opera") != -1) && ((browser.indexOf("Microsoft") != -1) || (browser.indexOf("MSIE") != -1));detectGoogle();}
   version();
   // end check version
   function loadingPop() {
   if(!usingClick && !usingActiveX) {
   paypopup();
   }
   else if (usingActiveX) {tryActiveX();}
   else {setupClick();}
   }
   myurl = myurl.substring(0, myurl.indexOf(’/’,8));
   if (myurl == ’’) {myurl = ’.’;}
   setupActiveX();
   loadingPop();
   self.focus();

时间: 2024-08-30 10:55:40

js不被IE拦截弹出窗口代码的相关文章

JS实现点击登录弹出窗口同时背景色渐变动画效果_javascript技巧

本文实例讲述了JS实现点击登录弹出窗口同时背景色渐变动画效果.分享给大家供大家参考,具体如下: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <STYLE> #login{ position: relative; display: none;

JS弹出窗口代码大全(详细整理)_javascript技巧

如何利用网页弹出各种形式的窗口,我想大家大多都是知道些的,但那种多种多样的弹出式窗口是怎么搞出来的,我们今天就来学习一下: 1.弹启一个全屏窗口 复制代码 代码如下: <html> <body http://www.jb51.net','','fullscreen');">; <b>www.jb51.net</b> </body> </html> 2.弹启一个被F11化后的窗口 复制代码 代码如下: <html>

超详细的JS弹出窗口代码大全_javascript技巧

如何利用网页弹出各种形式的窗口,我想大家大多都是知道些的,但那种多种多样的弹出式窗口是怎么搞出来的,我们今天就来学习一下:  1.弹启一个全屏窗口 代码如下:  <html> <body http://www.jb51.net','','fullscreen');">; <b>www.jb51.net</b> </body> </html> 2.弹启一个被F11化后的窗口 代码如下:  <html> <bo

aspx 页面弹出窗口代码大全_实用技巧

//关闭,父窗口弹出对话框,子窗口直接关闭 this.Response.Write("<script language=javascript>window.close();</script>"); //关闭,父窗口和子窗口都不弹出对话框,直接关闭 this.Response.Write("<script>"); this.Response.Write("{top.opener =null;top.close();}&qu

禁止iframe页面的所有js脚本如alert及弹出窗口等_javascript技巧

今天做一个小软件遇到一个问题,就是在一个页面里面需要放一个iframe框架来预览网站,可是被预览的这个网站中含有很多js脚本,如弹出窗口,提示框,最可恶的是一直让设为首页和加入收藏,我想应该有办法禁止iframe里面的脚本吧,于是百度了一下,还发现不少新大陆,于是解决了这个问题,记录下来,方便以后查询,也方便大家参考: <iframe src="fillseo.html"></iframe> fillseo.html里面有个js脚本,其中有alert,还有弹出窗

js 实现Lightbox效果的弹出对话框代码

相信LightBox之类的页面弹出窗口,大家在浏览的时候也应该是很常见的,实现起来也不算太困难,CG今天把在上次发布的ETP项目源代码中的JS部分提取出来,方便大家学习和使用. 实现原理:利用DIV的浮动和层的重叠,将对话框的Z-index设置为最高就可以了另外对于遮罩层来说,只要使遮罩层在对话框层之下,其他页面元素之上即可,如果需要美观的话,可以设置半透明效果. CSS代码如下:(保存成messageBox.css)  代码如下 复制代码 /** *文件名:messageBox.css *作者

五种形式的网页弹出窗口代码详解

弹出窗口|网页|详解 1.弹启一个全屏窗口 <html> <body http://www.webjx.com','example01','fullscreen'/">http://www.webjx.com','example01','fullscreen');"> <b>www.webjx.com</b> </body> </html> 运行代码复制代码另存代码 --您可以运行代码察看特效,您也可以复制或

js 强制退出弹出窗口代码

var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6"; function ext() //在关闭IE窗口的时候弹出 { if(window.event.clientY<132 || altKey){  var ck=getCookie("in24");  if(ck==null || ck==undefined){   iie.launchURL(popURL);   addCookie("in24"

js 强制弹出窗口代码研究-又一款代码_广告代码

复制代码 代码如下: <script language="JavaScript"> var paypopupURL = "http://www.jb51.net"; var randkey = '13'; //bypass IE functions function setupActiveX(){ document.write(' <INPUT ID="autoHit" TYPE="TEXT" ONKEYPR