navigator.appName:浏览器名称;
navigator.appVersion:浏览器版本;
navigator.language:浏览器设置的语言;
navigator.platform:操作系统类型;
navigator.userAgent:浏览器设定的User-Agent字符串。
'use strict';
alert('appName = ' + navigator.appName + '\n' +
'appVersion = ' + navigator.appVersion + '\n' +
'language = ' + navigator.language + '\n' +
'platform = ' + navigator.platform + '\n' +
'userAgent = ' + navigator.userAgent);

screen.width:屏幕宽度,以像素为单位;
screen.height:屏幕高度,以像素为单位;
screen.colorDepth:返回颜色位数,如8、16、24。
'use strict';
alert('Screen size = ' + screen.width + ' x ' + screen.height);

http://www.example.com:8080/path/index.html?a=1&b=2#TOP

location.protocol; // 'http'
location.host; // 'www.example.com'
location.port; // '8080'
location.pathname; // '/path/index.html'
location.search; // '?a=1&b=2'
location.hash; // 'TOP'
'use strict';
if (confirm('重新加载当前页' + location.href + '?')) {
location.reload();
} else {
location.assign('/discuss'); // 设置一个新的URL地址
}

'use strict';
// 获取当前浏览器title
alert(document.title)
// 更改title
document.title = '百哥么么哒';

// 获取cookie
alert(document.cookie)

javascript_获取浏览器属性的更多相关文章

  1. 快捷获取浏览器(navigator对象)的全部属性

    理论:     navigator对象包含关于web浏览器的信息,浏览器的类型,版本信息都可以从该对象获取. 属性 说明 appCodeName 浏览器代码说明 appName 浏览器名称 appVe ...

  2. 原生JS 获取浏览器、窗口、元素等尺寸的方法及注意事项

    一.通过浏览器获得屏幕的尺寸 screen.width screen.height screen.availHeight //获取去除状态栏后的屏幕高度 screen.availWidth //获取去 ...

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

    Navigator 对象包含有关浏览器的信息. Navigator 对象属性和方法: <html> <head> <title>JS完整获取浏览器信息</ti ...

  4. JS 获取浏览器窗口大小

    JS 获取浏览器窗口大小 <script> // 获取窗口宽度 if (windows.innerWidth) { winWidth = windows.innerWidth; } els ...

  5. js中获取css属性

    直接获取 window.onload = function() { var but = document.getElementById('button'); var div = document.ge ...

  6. JS 获取浏览器和屏幕宽高等信息代码

    JS 获取浏览器和屏幕宽高等信息. 网页可见区域宽:document.body.clientWidth  网页可见区域高:document.body.clientHeight  网页可见区域宽:doc ...

  7. js获取浏览器高度和宽度值,尽量的考虑了多浏览器。

    js获取浏览器高度和宽度值,尽量的考虑了多浏览器. IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ...

  8. js获取浏览器基本信息:document.body.clientWidth/clientHeight/scrollWidth/scrollTop。(转)

    js获取浏览器基本信息:document.body.clientWidth/clientHeight/scrollWidth/scrollTop. 分类: js.jquery.ext.js技术2011 ...

  9. JS获取浏览器可视区域尺寸

    本文所说的是浏览器窗口的可视区域大小,不是浏览器窗口大小,也非页面尺寸. 在没有声明DOCTYPE的IE中,浏览器显示窗口大小只能以下获取: document.body.offsetWidth doc ...

随机推荐

  1. iOS开发 百度坐标点的计算

    BMKMapPoint point1 = BMKMapPointForCoordinate(_userGps); BMKMapPoint point2 = BMKMapPointForCoordina ...

  2. spring boot初探

    又被领导鄙视了,说让先把程序跑起来,再去研究深层次的东西.. 我又一次没有学会走就要开始跑了..说干就干 eclipse mars下载 新建maven project 加依赖 <dependen ...

  3. JPA用myeclipse生成bean

  4. string.Format格式化

    ,)//填充,结果为02,003

  5. javascript思维导图

    JavaScript 数组 JavaScript 函数基础 Javascript 运算符 JavaScript 流程控制 JavaScript 正则表达式 JavaScript 字符串函数 JavaS ...

  6. Vmware workstation 10 NAT功能总是不正常的原因

    原来运行一切正常的VMWARE WORKSTATION 10,突然出现NAT功能不能正常工作的情况. 表现是:如果将虚拟机的网卡设置为NAT模式,可以PING通网关及LAN内的主机,但是PING不通外 ...

  7. 一些iOS心得

    ARC 1,arc是什么? automatic referece counting   mrc mannualiOS5 之后出来的技术// 2,arc的原理是什么?//   在程序编译的时候,系统帮我 ...

  8. elasticsearch的服务器响应异常及应对策略

    目录: 1 _riverStatus Import_fail 2 es_rejected_execution_exception <429> 3 create_failed_engine_ ...

  9. ArrayList与普通数组的区别

    import java.util.ArrayList; public class Shuzuqubie { public static void main(String[] args){ String ...

  10. css2----单行过长的省略处理

    li{ width:300px; white-space:nowrap;表示怎样处理li容器中的空白部分,nowrap表强制不换行,直到文本结束或碰到</br> text-overflow ...