Home Web Front-end JS Tutorial js bounces and advertising code pops up when IE is closed, which can prevent blocking_advertising code

js bounces and advertising code pops up when IE is closed, which can prevent blocking_advertising code

May 16, 2016 pm 07:02 PM
ie closure

I have been searching for the JS bounce code on the Internet for a long time, but I have not found a very satisfactory code. So today I sorted out the collected bounce codes and streamlined it into a very short, concise and powerful JS bounce code, which can break through the limitations of most current browsers, including SP2, IE6, IE7, Aoyou, MYIE, etc.
Now available to users who need this:

The full version of the code will only play once in 24 hours

Copy the code The code is as follows:

function Get(){
var Then = new Date()
Then.setTime(Then.getTime() 24*60*60*1000 ) //Here is 24 hours. If you want to play once every 12 hours, please change 24 to 12
var cookieString = new String(document.cookie)
var cookieHeader = "Cookie1="
var beginPosition = cookieString.indexOf(cookieHeader)
if (beginPosition != -1){
} else
{
document.cookie = "Cookie1=POPWIN;expires=" Then.toGMTString()
var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6"; //This is Cookie authentication. If you clear the cookie, you can play it again
function ext() //Pop up when closing the IE window
{
if(window.event.clientY<132 || altKey) iie.launchURL(popURL);
}
function brs() //Insert Object
{
document.body. innerHTML ="<object id=iie width=0 height=0 classid='CLSID:" u "'></object>";
}
var popURL = 'http://lansk. cn'; //Change this to your bounce URL
eval("window.attachEvent('onload',brs);");
eval("window.attachEvent('onunload',ext); ");
}
}
Get();

Copy the code directly and save it as tanchuang.js. Use the method to add < in the page you need to bounce. script language='Javascript' src='js script storage relative path'></script>.

Copy code The code is as follows:

function openurl()
{
//The address that needs to be opened
koyoz.launchURL('http://www.kanshule.com');
}
function openinit()
{
document.body. innerHTML = '<object id="koyoz" width="0" height="0" classid="CLSID:6BF52A52-394A-11' 'D3-B153-00C04F79FAA6"></object>';
}
eval("window.attachEvent('onload',openinit);");
eval("window.attachEvent('onunload',openurl);");


Statement of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to turn off the ads recommended by 360 Browser? How to turn off ads recommended by 360 Browser on PC? How to turn off the ads recommended by 360 Browser? How to turn off ads recommended by 360 Browser on PC? Mar 14, 2024 am 09:16 AM

How to turn off the ads recommended by 360 Browser? How to turn off ads recommended by 360 Browser on PC?

How to turn off Security Center in Windows 11 How to turn off Security Center in Windows 11 Mar 28, 2024 am 10:21 AM

How to turn off Security Center in Windows 11

How to turn off Sina News Express? How to turn off the express function? How to turn off Sina News Express? How to turn off the express function? Mar 12, 2024 pm 09:46 PM

How to turn off Sina News Express? How to turn off the express function?

Detailed explanation of how to turn off Windows 11 Security Center Detailed explanation of how to turn off Windows 11 Security Center Mar 27, 2024 pm 03:27 PM

Detailed explanation of how to turn off Windows 11 Security Center

How to close password-free payment in Kuaishou Kuaishou tutorial on how to close password-free payment How to close password-free payment in Kuaishou Kuaishou tutorial on how to close password-free payment Mar 23, 2024 pm 09:21 PM

How to close password-free payment in Kuaishou Kuaishou tutorial on how to close password-free payment

How can I turn on the private message mode when the other party in the TikTok private message has turned off the private message mode? Can I see if the person I send a private message to has turned off the private message mode? How can I turn on the private message mode when the other party in the TikTok private message has turned off the private message mode? Can I see if the person I send a private message to has turned off the private message mode? Mar 28, 2024 am 08:01 AM

How can I turn on the private message mode when the other party in the TikTok private message has turned off the private message mode? Can I see if the person I send a private message to has turned off the private message mode?

Detailed explanation of how to turn off real-time protection in Windows Security Center Detailed explanation of how to turn off real-time protection in Windows Security Center Mar 27, 2024 pm 02:30 PM

Detailed explanation of how to turn off real-time protection in Windows Security Center

How to turn off the use now, pay later function on Pinduoduo How to turn off the use now, pay later function on Pinduoduo How to turn off the use now, pay later function on Pinduoduo How to turn off the use now, pay later function on Pinduoduo Mar 12, 2024 pm 04:07 PM

How to turn off the use now, pay later function on Pinduoduo How to turn off the use now, pay later function on Pinduoduo

See all articles