显示访问者的操作系统和浏览器

 

点击这里看效果


在 <body> 与 </body> 之间加入:

<table border=0>
<tr> <td colspan="3">
你使用的操作系统是:

<script language = "JavaScript">
agent = navigator.userAgent;
if (agent.lastIndexOf("Win95"))
{
document.write(' Windows 95 以上 /NT');
}
else if (agent.lastIndexOf("Win16"))
{
document.write(' Windows 3.1');
}
else if (agent.lastIndexOf("Mac"))
{
document.write(' Macintosh');
}
else if (agent.lastIndexOf("Unix"))
{
document.write(' Unix');
}
else if (agent.lastIndexOf("Linux"))
{
document.write(' Linux');
}

</script>

. <br> 你使用的浏览器是: &nbsp;

<script language="JavaScript">
window.document.write(navigator.appName)
</script>

<script language="JavaScript">
window.document.write(parseInt(navigator.appVersion))
</script>

</td></tr>
</table>