当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
JavaScript学习进阶(2)
发布时间:2010/7/8 10:51:37 来源:城市学习网 编辑:ziteng
  本例子代码用来实现浏览器类型判断。
  <html>
  <head>
  <title>浏览器类型判断</title>
  </head>
  <body>
  <script type="text/javascript">
  document.write("浏览器类型:"+navigator.appName+"</br>;浏览器版本:"+navigator.appVersion);
  document.write("</br>");
  document.write("</br>");
  if(navigator.appName=="Microsoft Internet Explorer")
  {
  document.write("您使用的是IE浏览器");
  }
  else
  {
  document.write("您使用的不是IE浏览器");
  }
  </script>
  </body>
  </html>
  附浏览器的详细信息:
  浏览器:navigator.appName
  浏览器版本:navigator.appVersion
  代码:navigator.appCodeName
  平台:navigator.platform
  Cookies 启用:navigator.cookieEnabled
  浏览器的用户代理报头:navigator.userAgent
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved