Use JS to determine whether the user browser is XP SP2 ie6_javascript skills

Source: Internet
Author: User
Because of the Windows XP patch SP2, the security of the IE6 has also done a lot of promotion, so that there are a lot of original functions we can use, it will become very strange or even off the vegetables: (. In particular, pop-ups, modal windows, and popup windows are significantly affected. So can I tell if the user is using the IE6 is ordinary IE6 (IE6SP1) or IE6+XP SP2?

Here are two more typical IE6 browser useragent fields:

1, Windows XP + SP1 (NT 5.1)
Connection:keep-alive
Accept: */*
Accept-encoding:gzip, deflate
Accept-language:zh-cn
Host:zhilee.aehk.com
Referer:http://www.cnblogs.com/birdshome/archive/2005/03/11/113723.html
user-agent:mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1. NET CLR 1.1.4322)
2, Windows 2003 + SP1 (NT 5.2)
Connection:keep-alive
Accept: */*
Accept-encoding:gzip, deflate
Accept-language:zh-cn
Host:zhilee.aehk.com
Referer:http://www.cnblogs.com/bluefee/archive/2005/03/28/127455.html
user-agent:mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1. NET CLR 1.1.4322)
Ua-cpu:x86
The biggest difference between these two UA strings and the common UA string is that there is a "SV1" sign in it, what does this mean? SV1 is meant to be "security Version 1", which is used to specifically mark whether the operating system used by users using IE6 browsers is XPSP2 or WS03SP1.

Since XPSP2 and WS03SP1 have an impact on IE6, why not upgrade the version number of IE, but use the SVX annotation alone? As the IE development team explained, they said that while the patches on the two operating systems had an impact on IE6 settings, they did not modify any of the features of the IE6 itself, such as rendering, DHTML, and Dom. So some of these security settings are not suitable for upgrading the version number of IE itself.

In subsequent versions of IE, the SVX flag may be removed, so we currently use UA string to detect the SP version of the operating system, which is only a temporary solution.

var ua = navigator.useragent;
if (Ua.indexof ("SV1")!=-1)
{
if (Ua.indexof ("NT 5.1")!=-1)
{
Windows XP + SP2
}
else if (Ua.indexof ("NT 5.2")!=-1)
{
Windows 2003 + SP1
}
Else
{
Wrong user agent string
}
}

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.