JS获取浏览器名和版本信息

Navigator 对象包含有关浏览器的信息。 

Navigator 对象属性和方法: 

<html>
  <head>
    <title>JS完整获取浏览器信息</title>
  </head>
  <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table width="435" border="1" cellspacing="3" cellpadding="0">
      <tr>
        <td>浏览器名称</td>
        <td>
          <script>document.write(navigator.appName)</script>
        </td>
      </tr>
      <tr>
        <td >浏览器版本</td>
        <td >
          <script>document.write(navigator.appVersion)</script>
        </td>
      </tr>
      <tr>
        <td>浏览器语言</td>
        <td>
          <script>document.write(navigator.browserLanguage)</script>
        </td>
      </tr>
      <tr>
        <td >CPU类型</td>
        <td >
          <script>document.write(navigator.cpuClass)</script>
        </td>
      </tr>
      <tr>
        <td>操作系统</td>
        <td>
          <script>document.write(navigator.platform)</script>
        </td>
      </tr>
      <tr>
        <td >系统语言</td>
        <td >
          <script>document.write(navigator.systemLanguage)</script>
        </td>
      </tr>
      <tr>
        <td>用户语言;</td>
        <td>
          <script>document.write(navigator.userLanguage)</script>
        </td>
      </tr>
      <tr>
        <td >在线情况</td>
        <td >
          <script>document.write(navigator.onLine)</script>
        </td>
      </tr>
      <tr>
        <td>屏幕分辨率</td>
        <td>

          <script>document.write(window.screen.width+"x"+window.screen.height)</script>

        </td>
      </tr>
      <tr>
        <td>颜色</td>
        <td> <script>document.write(window.screen.colorDepth+"位")</script></td>
      </tr>
      <tr>
        <td>字体平滑</td>
        <td><script>document.write(window.screen.fontSmoothingEnabled)</script></td>
      </tr>
      <tr>
        <td>appMinorVersion</td>
        <td>
          <script>document.write(navigator.appMinorVersion)</script>
        </td>
      </tr>
      <tr>
        <td >appCodeName</td>
        <td >
          <script>document.write(navigator.appCodeName)</script>
        </td>
      </tr>
      <tr>
        <td>cookieEnabled</td>
        <td>
          <script>document.write(navigator.cookieEnabled)</script>
        </td>
      </tr>
      <tr>
        <td >userAgent</td>
        <td >
          <script>document.write(navigator.userAgent)</script>
        </td>
      </tr>
      <tr>
        <td>javaEnabled</td>
        <td>
          <script>document.write(navigator.javaEnabled())</script>
        </td>
      </tr>
      <tr>
        <td >taintEnabled</td>
        <td >
          <script>document.write(navigator.taintEnabled())</script>
        </td>
      </tr>
    </table>
  </body>
</html>

转载于:https://www.cnblogs.com/dingjiaoyang/p/5180056.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值