[JavaScript]浏览器检测

w3school真是一个学习JavaScript的好网站.

上面的例子浅显易懂,还有即时的代码效果演示,可以对代码进行修改然后显示修改后的结果.

这个JavaScript 浏览器检测也是w3school上的一个范例.

http://akem.name/JS/browser/browser.html

以下是Chrome的检测结果:

CodeName = Mozilla
MinorVersion = undefined
Name = Netscape
Version = 5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.43 Safari/534.7
CookieEnabled = true
CPUClass = undefined
OnLine = true
Platform = Win32
UA = Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.43 Safari/534.7
BrowserLanguage = undefined
SystemLanguage = undefined
UserLanguage = undefined

 

以下是IE9的检测结果:

CodeName = Mozilla
MinorVersion = 0
Name = Microsoft Internet Explorer
Version = 5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Tablet PC 2.0)
CookieEnabled = true
CPUClass = x86
OnLine = true
Platform = Win32
UA = Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Tablet PC 2.0)
BrowserLanguage = zh-cn
SystemLanguage = zh-cn
UserLanguage = zh-cn

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注