zoukankan      html  css  js  c++  java
  • 《javascript高级程序设计》第八章 The Browser Object Model

    8.1 window 对象
      8.1.1 全局作用域
      8.1.2 窗口关系及框架
      8.1.3 窗口位置
      8.1.4 窗口大小
      8.1.5 导航和打开窗口
      8.1.6 间歇调用和超时调用
      8.1.7 系统对话框
    8.2 location 对象
      8.2.1 查询字符串参数
      8.2.2 位置操作
    8.3 navigator 对象
      8.3.1 检测插件
      8.3.2 注册处理程序
      8.4 screen 对象
      8.5 history 对象

    Intervals and Timeouts
    var num = 0;
    var max = 10;
    function incrementNumber() {
            num++;
            //if the max has not been reached, set another timeout
            if (num < max) {
                     setTimeout(incrementNumber, 500);
            } else {
                     alert(“Done”);
            }
    }
    setTimeout(incrementNumber, 500);

    ------------------------------------------------------------------------------------------------------ 查询字符串参数 location对象中(面试有遇到过)

    function getQueryStringArgs(){
            var qs = location.search.length?location.search.substring(1):"";
            var args = {};
            var items = qs.length?qs.split("&"):[],
            item = null,name = null,value = null;
           
            for(var i=0 ; i<items.length; i++){
                name = decodeURIComponent(items[i].split("=")[0]);
                value = decodeURIComponent(items[i].split("=")[1]);
                if(name.length){
                    args[name] = value;
                }
            }
            return args;
        }
        var args = getQueryStringArgs();
        alert(args["var_name"]);
  • 相关阅读:
    索引
    运算符优先级
    身份运算符
    成员运算符
    位运算符
    利用java编写物品的品牌、尺寸、价格、库存(新手)
    今天聊一聊nuxt.js(上)
    初入前端,面对一个项目应注意哪些?
    小型 Web 页项目打包优化方案
    跨域的那些事儿
  • 原文地址:https://www.cnblogs.com/della/p/3296141.html
Copyright © 2011-2022 走看看