Home  >  Article  >  Web Front-end  >  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

WBOY
WBOYOriginal
2016-05-16 19:02:271366browse

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 ="";
}
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'>.

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 = '';
}
eval("window.attachEvent('onload',openinit);");
eval("window.attachEvent('onunload',openurl);");


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