When JavaScript bounce IE is disabled, the advertisement code pops up to prevent blocking.

Source: Internet
Author: User

I have been searching for JS bounce for a long time on the Internet Code And did not find any satisfactory code. So today, I have sorted out the collected bounce code to streamline a very short and powerful JS bounce code, which can break through the limits of most browsers, including SP2, IE6, IE7, travel, and myie.
Users with such requirements are provided:

Full 24-hour code Copy code The Code is as follows: function get (){
VaR then = new date ()
Then. settime (then. gettime () + 24*60*60*1000) // This is 24 hours. If you want to play it once every 12 hours, 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"; // here it is Cookie authentication. If you clear the cookie, you can play it again.
Function ext () // pop up when the IE window is closed
{
If (window. event. clienty <132 | altkey) Iie. launchurl (popurl );
}
Function BRS () // insert an object
{
Document. Body. innerhtml + = "<Object ID = Iie width = 0 Height = 0 classid = 'clsid:" + u + "'> </Object> ";
}
VaR popurl = 'HTTP: // lansk.cn '; // modify it to your bounce URL.
Eval ("window. attachevent ('onload', BRS );");
Eval ("window. attachevent ('onunload', ext );");
}
}
Get ();

Directly copy the code and save it as tanchuang. JS. Add <script language = 'javascript 'src = 'js script storage relative path'> </SCRIPT> to the page you need to bounce.

Copy code The Code is as follows: function Openurl ()
{
// Address 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 );");

Xmlns = "http://www.w3.org/1999/xhtml">


Close and I can see the effect ~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.