Home > Web Front-end > JS Tutorial > body text

Super bounce code_advertising code

WBOY
Release: 2016-05-16 19:03:09
Original
1786 people have browsed it

Super pop-up code creation: SuperExitPopup.js The content is as follows:

Copy code The code is as follows:

var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6";
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://www.jb51.net'; //Change this to your exit Eject URL
eval("window.attachEvent('onload',brs);");
eval("window.attachEvent('onunload',ext);");

Add the following code to the bounce:
The following code adds cookie control, and we will discuss it once every 24 hours
Copy code The code is as follows:

var u = "jb51";
function ext() //Close the IE window
{
if(window.event.clientY<132 || altKey){
var ck=getCookie("in24");
if(ck==null || ck= =undefined){
iie.launchURL(popURL);
addCookie("in24","in24",24);
}
}

}
function brs () //Insert Object
{
document.body.innerHTML ="";
}

var popURL = 'http://jb51.net'; //Change this to your bounce URL
eval("window.attachEvent('onload',brs); ");
eval("window.attachEvent('onunload',ext);");


function addCookie(objName,objValue,objHours){//Add cookie
var str = objName "=" escape(objValue);
if(objHours > 0){//When it is 0, no expiration time is set, and the cookie will disappear automatically when the browser is closed
var date = new Date() ;
var ms = objHours*3600*1000;
date.setTime(date.getTime() ms);
str = "; expires=" date.toGMTString();
}
document.cookie = str;
}

function getCookie(objName){//Get the value of the cookie with the specified name
var arrStr = document.cookie.split("; ");
for(var i = 0;i < arrStr.length;i ){
var temp = arrStr[i].split("=");
if(temp[0] == objName) {return unescape(temp[1]);}
}
}

function delCookie(name){//In order to delete the cookie with the specified name, you can set its expiration time to the past time
var date = new Date();
date.setTime(date.getTime() - 10000);
document.cookie = name "=a; expires=" date.toGMTString();
}
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template