JavaScript要怎么才能检测浏览器的全部信息,其实这一段代码如果自己写的话会很不方便,大家不妨复制下来使用就可以了。
JavaScript教程之检测浏览器的全部信息实例
《html》
《body》
《script type=“text/javascript”》
var x = navigator;
document.write(“CodeName=” + x.appCodeName);
document.write(“《br /》”);
document.write(“MinorVersion=” + x.appMinorVersion);
document.write(“《br /》”);
document.write(“Name=” + x.appName);
document.write(“《br /》”);
document.write(“Version=” + x.appVersion);
document.write(“《br /》”);
document.write(“CookieEnabled=” + x.cookieEnabled);
document.write(“《br /》”);
CodeName=Mozilla
MinorVersion=0
Name=Microsoft Internet Explorer
Version=4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET4.0C; .NET4.0E; Maxthon 2.0)
CookieEnabled=true
CPUClass=x86
OnLine=true
Platform=Win32
UA=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET4.0C; .NET4.0E; Maxthon 2.0)
BrowserLanguage=zh-cn
SystemLanguage=zh-cn
UserLanguage=zh-cn
document.write(“CPUClass=” + x.cpuClass);
document.write(“《br /》”);
document.write(“OnLine=” + x.onLine);
document.write(“《br /》”);
document.write(“Platform=” + x.platform);
document.write(“《br /》”);
document.write(“UA=” + x.userAgent);
document.write(“《br /》”);
document.write(“BrowserLanguage=” + x.browserLanguage);
document.write(“《br /》”);
document.write(“SystemLanguage=” + x.systemLanguage);
document.write(“《br /》”);
document.write(“UserLanguage=” + x.userLanguage);
《/script》
《/body》
《/html》