JS window对象 Navigator对象 Navigator 对象包含有关浏览器的信息,通常用于检测浏览器与操作系统的版本。
Navigator对象
Navigator 对象包含有关浏览器的信息,通常用于检测浏览器与操作系统的版本。
对象属性:
查看浏览器的名称和版本,代码如下:
- <script type="text/javascript">
- var browser=navigator.appName;
- var b_version=navigator.appVersion;
- document.write("Browser name"+browser);
- document.write("<br>");
- document.write("Browser version"+b_version);
- </script>
任务
在右边编辑器script标签内,使用Navigator对象,查看浏览器相关信息。
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>无标题文档</title>
- </head>
- <script type="text/javascript">
- var browser = navigator.appCodeName;
- var version = navigator.appVersion;
- var appcode = navigator.appCodeName;
- var plat = navigator.platform;
- var agent = navigator.userAgent;
- document.write("BrowserName:"+browser+"<br/>"+"BrowserVersion:"+version+"<br/>"+"CodeName:"+appcode+"<br>"+"platform:"+plat+"<br>"+"agent:"+agent);
- </script>
- <body>
- </body>
- </html>
JS window对象 Navigator对象 Navigator 对象包含有关浏览器的信息,通常用于检测浏览器与操作系统的版本。的更多相关文章
- JS BOM基础 全局对象 window location history screen navigator
全局变量声明的两种方式:1,window.变量名=值;2,var 变量名=值; 全局函数声明的两种方式:1,window.函数名=function(){}2,function 函数名=function ...
- JS window对象 userAgent 返回用户代理头的字符串表示(就是包括浏览器版本信息等的字符串) 语法 navigator.userAgent
userAgent 返回用户代理头的字符串表示(就是包括浏览器版本信息等的字符串) 语法 navigator.userAgent 几种浏览的user_agent.,像360的兼容模式用的是IE.极速模 ...
- 《JAVASCRIPT高级程序设计》window/location/navigator/screen/history对象
如果要在web中使用JAVASCRIPT,那么BOM(浏览器对象模型)毫无疑问是最重要的部分.BOM提供了很多对象,例如,window.location.navigator.screen.histor ...
- Javascript进阶篇——浏览器对象—Location、Navigator、userAgent、screen对象
Location对象location用于获取或设置窗体的URL,并且可以用于解析URL.语法: location.[属性|方法] location对象属性图示: location 对象属性: loca ...
- BOM 对象--location、navigator、screen、history
1.location 对象 location提供了与当前窗口中加载的文档有关的信息,还有一些导航功能.需要注意的是,window.location 和 document.location 引用的是同一 ...
- JS window对象详解
window 是客户端浏览器对象模型的基类,window 对象是客户端 JavaScript 的全局对象.一个 window 对象实际上就是一个独立的窗口,对于框架页面来说,浏览器窗口每个框架都包含一 ...
- js window对象
BOM的核心对象是window,它表示浏览器的一个实例. 在浏览器中,window对象是(1)通过JavaScript访问浏览器窗口的一个接口 (2)ECMAScript规定的Global对象 1.全 ...
- 【repost】js window对象属性和方法相关资料整理
window对象有以下方法: open close alert confirm prompt setTimeout clearTimeout setInterval clearInterval mov ...
- js window对象属相和方法相关整理资料
window对象有以下方法: open close alert confirm prompt setTimeout clearTimeout setInterval clearInterval mov ...
随机推荐
- Centos7下编译安装php扩展redis5.0.2
安装环境:centos7 + php 7.2.191. 下载地址:http://pecl.php.net/get/redis-5.0.2.tgz .tgz http://pecl.php.net/ge ...
- react学习笔记_02-元素渲染
const element = <h1>Hello, world</h1>; 上面的内容代表react中的一个元素,元素是构成 React 应用的最小砖块. 与浏览器的 DOM ...
- Linux Centos 7 下部署 .NetCore + MySql + Redis + mssql2007 部署过程
1. net core 安装及运行配置 安装 1)rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-p ...
- Android 混淆总结(直接copy)(转)
转自:http://blog.csdn.net/u012188405/article/details/51985273 # Add project specific ProGuard rules he ...
- 【串线篇】REST风格的请求格式
1.什么是rest 答出这两点就够了: 1.1 统一接口 rest其实是基于HTTP的,四种方式. RESTful架构风格规定,数据的元操作,即CRUD(create, read, update和de ...
- mysql添加中文数据失败
日志信息: INFO 2015-01-13 10:44:36,078 org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Lo ...
- pywin3的简介
微软Windows的Python扩展提供了对Win32 API的访问.创建和使用COM对象的能力以及PythOnWin环境.Pywin32是一个Python库,为python提供访问Wind ...
- 【UML】最简单的类图
Rational Rose简明实用教程 https://blog.csdn.net/gz153016/article/details/49641847 Rational Rose是Rational公 ...
- node快速起web服务器
首选,安装http-server模块 npm install http-server -g 在需要打开的静态页面的目录下,开启服务即可 http-server
- String path = request.getContextPath();报错
String path = request.getContextPath();报错 1. 右击该项目 - Build Path - Configure Build Path , 在 Libraries ...