Heim  >  Artikel  >  Web-Frontend  >  javascript 强制弹出窗口代码-跨拦截_广告代码

javascript 强制弹出窗口代码-跨拦截_广告代码

WBOY
WBOYOriginal
2016-05-16 18:52:061343Durchsuche

强制弹出窗口代码研究-ForceWindow
此为一款老代码,本代码是通过构建一个 Form,然后用 JS 去 submit 这个 Form(也可以模拟提交按钮被 click)。我在 IE8 中测试起作用,但在 Firefox 3.5 中被拦截。

复制代码 代码如下:

ForceWindow.iclass.js 代码如下(使用、讲解、相关说明全部在注释中):
/**
* ======================================================
* 本程序可自由复制、修改、传播,不得删除以下信息。如用于商业用途须经原作者同意方可使用。
* ===============================================
* 程序名称:ForceWindow(@iClass.JS)
* 描  述:“冲破”广告拦截软件,强制弹出窗口。
* 版  本:1.0.0
* 创建时间:2004 年 1 月 19 日
* 修改时间:2004 年 1 月 19 日
* 文件名称:ForceWindow.iclass.js
* 作  者:钟钟
* 邮箱地址:zz@iecn.net zz315@163.com
* 版权声明:本程序属于 iClass.JS,版权归作者所有。
* 有关 iClass 计划详见:http://www.iecn.net/forum/showthread.php?threadid=14811
* =================================================
*/
/**
* 定义 ForceWindow 类构造函数
* 无参数
* 无返回值
*/
function ForceWindow ()
{
this.r = document.documentElement;
this.f = document.createElement("FORM");
this.f.target = "_blank";
this.f.method = "post";
this.r.insertBefore(this.f, this.r.childNodes[0]);
}
/**
* 定义 open 方法
* 参数 sUrl:字符串,要打开窗口的 URL。
* 无返回值
*/
ForceWindow.prototype.open = function (sUrl)
{
this.f.action = sUrl;
this.f.submit();
}
/**
* 实例化一个 ForceWindow 对象并做为 window 对象的一个子对象以方便调用
* 定义后可以这样来使用:window.force.open("URL");
*/
window.force = new ForceWindow();
/**
* 用本程序弹出的窗口将不会被广告拦截软件拦截,但有一个缺点:你无法象对 window.open 弹出的窗口那样对外观进行定制。
* 你当然也可以在使用前实例化一个 ForceWindow 对象:
* var myWindow = new ForceWindow();
* 这样来使用:
* myWindow.open("URL");
* 本程序测试通过的浏览器:IE 5+、Firefox 1.0、Mozilla 1.7.5、Netscape 7.2、Opera 7.23
* 友情提示:如果你将本程序用于强制弹出广告,请更多的想想浏览者的感受!
*/

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn