-
UID:2
-
- 注册时间2005-01-04
- 最后登录2024-07-30
- 在线时间128小时
-
- 发帖600
- 搜Ta的帖子
- 精华47
- PB3246
- 威望526
- 贡献值187
- 交易币124
- 好评度279
-
访问TA的空间加好友用道具
|
- <!doctype html public "-//W3C//DTD XHTML 1.1//EN" "[url=http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd]http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd[/url]">
- <html xmlns="[url=http://www.w3.org/1999/xhtml]http://www.w3.org/1999/xhtml[/url]">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <meta name="generator" content="editplus2.21" />
- <meta name="author" content="jiucai" />
- <meta name="keywords" content="" />
- <meta name="description" content="" />
- <title>浏览器信息探测</title>
- </head>
- <body>
- <script language="javascript" type="text/javascript">
- <!--
- /**
- *
- * 获取浏览器所支持的Flash插件的版本
- *
- * this function comes from Google Analytics Urchin Module
- *
- * @return flash version string and number
- */
- function getFlashVersion()
- {
- var f="-",n=navigator;
- if (n.plugins && n.plugins.length)
- {
- for (var ii=0;ii<n.plugins.length;ii++){
- if (n.plugins[ii].name.indexOf('Shockwave Flash')!=-1)
- {
- f=n.plugins[ii].description.split('Shockwave Flash ')[1];
- break;
- }
- }
- }
- else if (window.ActiveXObject)
- {
- for (var ii=10;ii>=2;ii--)
- {
- try
- {
- var fl=eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+ii+"');");
- if (fl)
- {
- f=ii + '.0'; break;
- }
- }
- catch(e)
- {
- }
- }
- }
- return f;
- }
- /*
- appCodeName 指定浏览器的代码名称。
- appName 指定浏览器的名称。
- appVersion 指定 Navigator 的版本信息。
- language 标明正在使用的 Navigator 的翻译语种。
- mimeTypes 客户端支持的所有 MIME 类型数组。
- platform 标明了 Navigator 编译适合的机器类型。
- plugins 客户端已安装的所有插件数组。
- userAgent 指定了用户代理头。
- document.write(navigator.userAgent + "<br />");
- */
- /**
- *
- * 获取浏览器的名称和版本
- *
- * @author jiucai<[url=mailto:[email protected]][email protected][/url]>
- *
- * @createDate 2006-8-30
- *
- * @return Browser name and version in lowercase , such as "msie_6.0"
- */
- function getBV()
- {
-
- var bs = new Array();
- var bsLen = new Array();
- bs[0]="MSIE";
- bs[1]="Firefox";
- bs[2]="Netscape";
- bs[3]="Opera";
- //you could add browser here...
- bs[4]="Unkown"; //leave the last one unkonw
-
- for (i = 0; i < bs.length; i++)
- {
- bsLen [i] = bs[i].length +1 ; // to jump over "/"
- //document.write("bs[" + i + "] = " +bsLen [i] + "<br />");
- }
- var unkown = bs[bs.length] + "_0";
- var n = navigator.userAgent;
- var len = n.length;
-
- var token = n.indexOf(") ");
- var str = token > 0 ? n.substring( token + 2,token+len) : "";
-
- // Firefox
- var isFirefox = n.indexOf(bs[1]);
- var vFirefox = isFirefox > 0 ? n.substring(isFirefox + bsLen[1], isFirefox+len) : "";
- // Netscape
- var isNetscape = n.indexOf(bs[2]);
- var vNetscape = isNetscape > 0 ? n.substring(isNetscape + bsLen[2], isNetscape+len) : "";
-
- // Opera
- var isOpera = n.indexOf(bs[3]);
- var vOpera = isOpera > 0 ? n.substring(isOpera + bsLen[3], isOpera+len) : "";
- if (str=="")
- {
- // IE
- var isMSIE = n.indexOf(bs[0]);
- var vMSIE = isMSIE > 0 ? n.substring(isMSIE + bsLen[0], n.indexOf(";",isMSIE + 5)) : "";
- if(vMSIE)
- return bs[0].toLowerCase() + "_" + vMSIE;
- else
- return unkown.toLowerCase();
- }
- else if(vFirefox)
- {
- return (bs[1] + "_" + vFirefox).toLowerCase();
- }
- else if(vNetscape)
- {
- return (bs[2] + "_" + vNetscape).toLowerCase();
- }
- else if(vOpera)
- {
- return (bs[3].toLowerCase() + "_" + vOpera).toLowerCase();
- }
- else
- {
- return unkown.toLowerCase();
- }
- }
- /**
- *
- * 获取客户端信息
- *
- * this function comes from Google Analytics Urchin Module
- *
- * @return url string of client info
- */
- function clientInfo()
- {
- var sr="-",sc="-",ul="-",fl="-",je=1;
- var n=navigator;
- if (self.screen)
- {
- sr=screen.width+"x"+screen.height;
- sc=screen.colorDepth+"-bit";
- }
- else if (self.java)
- {
- var j=java.awt.Toolkit.getDefaultToolkit();
- var s=j.getScreenSize();
- sr=s.width+"x"+s.height;
- }
- if (n.language)
- {
- ul=n.language.toLowerCase();
- }
- else if (n.browserLanguage)
- {
- ul=n.browserLanguage.toLowerCase();
- }
- je=n.javaEnabled() ? 1 : 0;
- fl=getFlashVersion();
- bv=getBV();
- //返回客户端信息字符串
- return "&_u_sreen="+sr+"&_u_colordepth="+sc+"&_u_lang="+ul + "&_u_bv=" + bv + "&_u_java="+je+"&_u_flashversion="+fl;
- }
- biStr=encodeURI(clientInfo());
- document.write(biStr + "<br />");
- //document.write(decodeURI(biStr));
- //-->
- </script>
- </body>
- </html>
|