javascript force pop-up window code-cross-blocking_advertising code
WBOYOriginal
2016-05-16 18:52:061409browse
Research on forced pop-up window code - ForceWindow This is an old code. This code builds a Form and then uses JS to submit the Form (it can also simulate the submit button being clicked). I tested it in IE8 and it works, but it's blocked in Firefox 3.5.
ForceWindow.iclass.js code is as follows (use, explanation, Relevant instructions are all in comments): /** * ============================================== ======== * This program can be freely copied, modified, and disseminated, and the following information may not be deleted. Commercial use must be approved by the original author. * ============================================== = * Program name: ForceWindow(@iClass.JS) * Description: "Breakthrough" ad blocking software and force pop-up windows. * Version: 1.0.0 * Creation time: January 19, 2004 * Modification time: January 19, 2004 * File name: ForceWindow.iclass.js * Author: Zhong Zhong * Email address: zz@iecn.net zz315@163.com * Copyright statement: This program belongs to iClass.JS, and the copyright belongs to the author. * For details about the iClass plan, please see: http://www.iecn.net/forum/showthread.php?threadid=14811 * ================= ================================ */ /** * Define ForceWindow class constructor * No parameters * No return value */ 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]); } /** * Define the open method * Parameters sUrl: String, the URL of the window to be opened. * No return value */ ForceWindow.prototype.open = function (sUrl) { this.f.action = sUrl; this.f.submit(); } /** * Instantiate a ForceWindow object and use it as a sub-object of the window object to facilitate calling * After definition, it can be used like this: window.force.open("URL"); */ window.force = new ForceWindow(); /** * Windows that pop up using this program will not be blocked by ad blocking software, but there is a drawback: you cannot customize the appearance like you can with window.open pop-up windows. * Of course you can also instantiate a ForceWindow object before use: * var myWindow = new ForceWindow(); * Use it like this: * myWindow.open("URL"); * Browsers that have passed the test of this program: IE 5, Firefox 1.0, Mozilla 1.7.5, Netscape 7.2, Opera 7.23 * Friendly reminder: If you use this program to force pop-up advertisements, please provide more Think about how the viewer feels! */
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn