JS detection client is not Firefox is prompted to download _javascript tips
Source: Internet
Author: User
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 (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);
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.