zoukankan      html  css  js  c++  java
  • javascript_获取浏览器属性

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

  • 相关阅读:
    HBase性能调优
    HBase原理和设计
    HBase 架构脑图
    Hadoop
    Hadoop YARN架构设计要点
    Hadoop-YARN
    Hadoop-HDFS
    TCP传输
    分布式系统常见的事务处理机制
    Zookeeper Client简介
  • 原文地址:https://www.cnblogs.com/TTyb/p/6124891.html
Copyright © 2011-2022 走看看