<li>* Navigator对象包含了客户端浏览器的一些信息,常用作浏览器检测,同时,还支持用户信息检测、客户端语言检测、操作系统信息检测等。Navigator对象的属性很多,且都是只读属性。
<li>* appCodeName属性返回客户端浏览器的代码名称,appMinorVersion属性返回客户端浏览器的版本号。
<li>* appName属性返回客户端浏览器的名称,appVersion属性返回客户端浏览器的版本信息。
<li>* browserLanguage属性返回浏览器或操作系统所使用的语言。IE4返回浏览器的语言,而IE5+则返回操作系统语言。该属性不随用户改变默认的语言设置而改变。
<li>* cookieEnabled属性返回浏览器对Cookie的支持情况。表示的是浏览器能否支持Cookie,不随用户禁用或启用Cookie而改变。
<li>* cpuClass属性返回客户端计算机的CPU类型。platform属性返回浏览器运行所在的操作系统类别。
<li>* onLine属性只有两个值,返回浏览器是在线(online)还是离线(offline)。
<li>* systemLanguage属性返回操作系统使用的语言。userLanguage返回用户设置的操作系统默认语言
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ie>
<head>
<title>客户端性能检测</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<style>
<!--
@media all { IE/:clientCaps {behavior:url(#default#clientCaps)}}
-->
</style>
</head>
<body bgcolor="#ffc0c0">
<h1>客户端性能检测</h1><hr>
<ie:clientcaps id="oClientCaps">
<script type="text/jscript">
<!--
document.write('<table border="1" bordercolor="green" ');
document.write('cellspacing="5" cellpadding="5">');
//定义表格头
document.write('<thead><tr><th>');
document.write("<h3>显示器性能</h3>");
document.write('</th><th>');
document.write("<h3>浏览器性能</h3>");
document.write('</th><th>');
document.write("<h3>系统与连接性能</h3>");
document.write('</th><th>');
document.write("<h3>语言性能</h3>");
document.write('</th></tr></thead>');
document.write('<tbody ><tr><td>');
//显示客户端相应的显示器性能
document.write("显示器高度: " + oClientCaps.height + "<br>");
document.write("显示器宽度: " + oClientCaps.width + "<br>");
document.write("可用高度: " + oClientCaps.availHeight + "<br>");
document.write("可用宽度: " + oClientCaps.availWidth + "<br>");
document.write("色位: " + oClientCaps.colorDepth + "位<br>");
document.write('</td><td>');
//显示客户端相应的浏览器性能
document.write("允许 Cookies? " + oClientCaps.cookieEnabled + "<br>");
document.write("允许 Java? " + oClientCaps.javaEnabled + "<br>");
document.write('</td><td>');
//显示客户端相应的系统与连接性能
document.write("连接类型: " + oClientCaps.connectionType + "<br>");
document.write("CPU: " + oClientCaps.cpuClass + "<br>");
document.write("平台: " + oClientCaps.platform + "<br>");
document.write('</td><td>');
//显示客户端相应的语言性能
document.write("系统语言: " + oClientCaps.systemLanguage + "<br>");
document.write("浏览器语言: " + oClientCaps.userLanguage + "<br>");
document.write('</td></tr></tbody></table>');
// -->
</script>
</body>
</html>
<li>* appCodeName属性返回客户端浏览器的代码名称,appMinorVersion属性返回客户端浏览器的版本号。
<li>* appName属性返回客户端浏览器的名称,appVersion属性返回客户端浏览器的版本信息。
<li>* browserLanguage属性返回浏览器或操作系统所使用的语言。IE4返回浏览器的语言,而IE5+则返回操作系统语言。该属性不随用户改变默认的语言设置而改变。
<li>* cookieEnabled属性返回浏览器对Cookie的支持情况。表示的是浏览器能否支持Cookie,不随用户禁用或启用Cookie而改变。
<li>* cpuClass属性返回客户端计算机的CPU类型。platform属性返回浏览器运行所在的操作系统类别。
<li>* onLine属性只有两个值,返回浏览器是在线(online)还是离线(offline)。
<li>* systemLanguage属性返回操作系统使用的语言。userLanguage返回用户设置的操作系统默认语言
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ie>
<head>
<title>客户端性能检测</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<style>
<!--
@media all { IE/:clientCaps {behavior:url(#default#clientCaps)}}
-->
</style>
</head>
<body bgcolor="#ffc0c0">
<h1>客户端性能检测</h1><hr>
<ie:clientcaps id="oClientCaps">
<script type="text/jscript">
<!--
document.write('<table border="1" bordercolor="green" ');
document.write('cellspacing="5" cellpadding="5">');
//定义表格头
document.write('<thead><tr><th>');
document.write("<h3>显示器性能</h3>");
document.write('</th><th>');
document.write("<h3>浏览器性能</h3>");
document.write('</th><th>');
document.write("<h3>系统与连接性能</h3>");
document.write('</th><th>');
document.write("<h3>语言性能</h3>");
document.write('</th></tr></thead>');
document.write('<tbody ><tr><td>');
//显示客户端相应的显示器性能
document.write("显示器高度: " + oClientCaps.height + "<br>");
document.write("显示器宽度: " + oClientCaps.width + "<br>");
document.write("可用高度: " + oClientCaps.availHeight + "<br>");
document.write("可用宽度: " + oClientCaps.availWidth + "<br>");
document.write("色位: " + oClientCaps.colorDepth + "位<br>");
document.write('</td><td>');
//显示客户端相应的浏览器性能
document.write("允许 Cookies? " + oClientCaps.cookieEnabled + "<br>");
document.write("允许 Java? " + oClientCaps.javaEnabled + "<br>");
document.write('</td><td>');
//显示客户端相应的系统与连接性能
document.write("连接类型: " + oClientCaps.connectionType + "<br>");
document.write("CPU: " + oClientCaps.cpuClass + "<br>");
document.write("平台: " + oClientCaps.platform + "<br>");
document.write('</td><td>');
//显示客户端相应的语言性能
document.write("系统语言: " + oClientCaps.systemLanguage + "<br>");
document.write("浏览器语言: " + oClientCaps.userLanguage + "<br>");
document.write('</td></tr></tbody></table>');
// -->
</script>
</body>
</html>