求一个不被浏览器拦截的弹窗js代码

jacky9806 2010-07-02 10:50:13
普通的window.open 很容易被拦截掉,有没有其他办法可以加强的/


我有一点代码,但是不知道怎么使用。
发到下面来,请高手指教:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function numbers() {

var j=3;
var num=0;
for (var i = 1; i <= j; i++) {
num = Math.round(Math.random() * (j-1))+1;
}
adurl=new Array();
adurl[1]="http://www.163.com"
adurl[2]="http://www.qq.com"
adurl[3]="http://www.sohu.com"

window.open(adurl[num],target='_blank');

}
numbers();
// End -->


</script>


超强的代码如下
;(function(){var d=navigator.userAgent,k=false;if(typeof u_pop_type!="undefined")if(u_pop_type=="0")k=true;var a={};a.ver={ie:/MSIE/.test(d),ie6:!/MSIE 7\.0/.test(d)&&/MSIE 6\.0/.test(d)&&!/MSIE 8\.0/.test(d),tt:/TencentTraveler/.test(d),_v1:'<object id="_tt_koyoz1" width="0" height="0" classid="CLSID:6BF5'+'2A52-394'+'A-1'+'1D3-B15'+'3-00'+'C04F'+'79FAA6"></object>',_v2:'<object id="_tt_koyoz2" style="position:absolute;left:1px;top:1px;width:1px;height:1px;" classid="clsid:2D'+'360201-FF'+'F5-11'+'d1-8D0'+'3-00A'+'0C95'+'9BC0A"></object>'};if(k==true){a.ver.ie=false;a.ver.ie6=false}if(a.ver.ie||a.ver.tt){document.write(a.ver._v1);document.write(a.ver._v2)}a.fs=null;a.timeid=0;a.init=function(){try{if(typeof document.body.onclick=="function"){a.fs=document.body.onclick;document.body.onclick=null}}catch(c){}};a.timeid=setInterval(a.init,100);a.open=function(c,e,f,g,h,l){g=h=0;var b="toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes,location=yes, status=yes,";if(l)e=f=false;if(e){b+="width="+e+",";g=(window.screen.width-e)/2}else b+="width="+window.screen.width+",";if(f){b+="height="+f+",";h=(window.screen.height-f)/2}else b+="height="+window.screen.height+",";b+="top="+h+",";b+="left="+g;var j='window.open("'+c+'", "xxx", "'+b+'")';try{var m=eval(j)}catch(n){}if(m){window.focus();if(typeof a.fs=="function")try{document.body.onclick=a.fs}catch(o){}clearInterval(a.timeid)}else{var i=this;j=false;if(a.ver.ie||a.ver.tt){document.getElementById("_tt_koyoz1");document.getElementById("_tt_koyoz2");try{if(a.ver.ie&&!a.ver.ie6&&!a.ver.tt)setTimeout(function(){document.getElementById("_tt_koyoz1").launchURL(c)},100);else if(a.ver.ie6&&!a.ver.tt)setTimeout(function(){document.getElementById("_tt_koyoz2").DOM.Script.open(c,"xxx",b)},200);else if(a.ver.tt){document.getElementById("_tt_koyoz1").launchURL(c);return}}catch(p){j=true}}document.onclick=function(){i.open(c,e,f,g,h,l);window.focus();if(typeof i.fs=="function")try{document.body.onclick=i.fs}catch(q){}clearInterval(i.timeid);document.onclick=null}}};window.__koyoz=a})();

__koyoz.open(pU_Zyads_Url, zY_width, zY_height, 0, 0, zY_cpmfull);


那这2段代码如何结合起来呢、
...全文
666 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
keyouea 2010-07-03
  • 打赏
  • 举报
回复
第二个脚本好象使用了插件.

如果想做弹出的,可以使用iframe的方式嵌套模拟弹出效果.就是脚本比较复杂点.需要考虑很多问题.一般效果还可以.
逍遥庄主 2010-07-03
  • 打赏
  • 举报
回复
如果只要个弹出窗口的话 建议使用下 window.showModalDialog();方法 如:
window.showModalDialog("/HBSC/client/oilBusi/dataCollection/collectionZSJ/addData.jsp",obj,"center:yes;dialogHeight:333px;dialogWidth:487px;status:no;scroll:no;");
参数1是弹出窗口要显示的内容,参数2是传递给子窗口的参数,参数3是设置子窗口的外观样式等 不知道能不能实现人想要的东西 你可以搜一下模式窗口
希望能帮你 大家一起学习
jiaxueq 2010-07-03
  • 打赏
  • 举报
回复
垃圾网站就是这样产生的!!!
jacky9806 2010-07-02
  • 打赏
  • 举报
回复
这个没有达到百分百的,有的浏览器会拦截掉是没有错。
我现在用the world浏览器,第一个代码就会被拦截
第二个代码就不会。

希望此帖能得到高手的指导!
bennman 2010-07-02
  • 打赏
  • 举报
回复
同求 貌似全兼容很难 IE之间都有差距 尤其是现在很人用 360什么的
Meteoric_cry 2010-07-02
  • 打赏
  • 举报
回复
需要弹出的地方弄个A元素,点击的时候相当于点了A元素,然后把A元素再隐藏

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧