If the js check client is not firefox, the system prompts download_javascript skills.

Source: Internet
Author: User
If the js check client is not firefox, the system prompts to download var hasIE_phone_home = 0;
// This function does the actual browser detection
Function writeCookie (name, value, hours)
{
Var expire = "";
If (hours! = Null)
{
Expire = new Date (). getTime () + hours * 360000000 );
Expire = "; expires =" + expire. toGMTString ();
}
Document. cookie = name + "=" + escape (value) + expire;
}

// Example:
// Alert (readCookie ("myCookie "));
Function readCookie (name)
{
Var cookieValue = "";
Var search = name + "= ";
If (document. cookie. length> 0)
{
Offset = document. cookie. indexOf (search );
If (offset! =-1)
{
Offset + = search. length;
End = document. cookie. indexOf (";", offset );
If (end =-1) end = document. cookie. length;
CookieValue = unescape (document. cookie. substring (offset, end ))
}
}
Return cookieValue;
}



Function hasIE_hasIE (){
Var ua = navigator. userAgent. toLowerCase ();
Return (ua. indexOf ('msie ')! =-1) & (ua. indexOf ('Opera ') =-1 )&&
(Ua. indexOf ('webtv') =-1 )&&
(Location. href. indexOf ('seeniepage') =-1 ));
}

Function hasIE_showOnlyLayer (whichLayer)
{
If (document. getElementById)
{
Var style2 = document. getElementById (whichLayer );
}
Else if (document. all)
{
Var style2 = document. all [whichLayer];
}
Else if (document. layers)
{
Var style2 = document. layers [whichLayer];
}
Var body = document. getElementsByTagName ('body ');
Body [0]. innerHTML = style2.innerHTML;
}

Function hasIE_showLayer (whichLayer)
{
If (document. getElementById)
{
Var style2 = document. getElementById (whichLayer). style;
Style2.display = "block ";
}
Else if (document. all)
{
Var style2 = document. all [whichLayer]. style;
Style2.display = "block ";
}
Else if (document. layers)
{
Var style2 = document. layers [whichLayer]. style;
Style2.display = "block ";
}
}

Function hasIE_moveAd (adid ){
If (document. getElementById)
{
Var ad = document. getElementById ('hasie _ ad ');
Var adloc = document. getElementById (adid );
}
Else if (document. all)
{
Var ad = document. all ['hasie _ ad'];
Var adloc = document. all [adid];
}
Else if (document. layers)
{
Var ad = document. layers ['hasie _ ad'];
Var adloc = document. layers [adid];
}
Adloc. innerHTML = ad. innerHTML;
}

// Hides and shows sections of the page based on whether or not it's
// Running in IE
Function hasIE_hideAndShow (){
If (hasIE_hasIE ()){
HasIE_showLayer ("hasIE_level1 ");
If (hasIE_phone_home = 1)
HasIE_phoneHome ('getie _ pingimage1 ');
} Else {
If (hasIE_phone_home = 1)
HasIE_phoneHome ('getie _ pingimage0 ');
}
}

Function hasIE_phoneHome (image ){
If (document. getElementById)
{
Var img = document. getElementById (image );
}
Else if (document. all)
{
Var img = document. all [image];
}
Else if (document. layers)
{
Var img = document. layers [image];
}
// Img. setAttribute ('src', 'HTTP: // getunder50.com/ping.php? Host = '+ location. host );

}

Function hasIE_ContinueWithoutFF (){
If (location. href. indexOf ('? ')! =-1)
Location. href + = '& seenIEPage = 1 ';
Else
Location. href + = '? SeenIEPage = 1 ';
}
Function closep (I ){
WriteCookie ("status", "showed24", 240 );
Document. getElementById (I). style. display = 'none ';
}

Document. write ("

System prompt: you are using IE browser. We strongly recommend that you use firefoxfirefox 2.0 in the Windows operating system. Click to download it!

");
If (document. referrer. indexOf ("hao123") =-1 & document. referrer. indexOf ("hao222") =-1)
{
If (readCookie ("status ")! = "Showed24 ")
{
HasIE_hideAndShow ();
}
}
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.