《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"]);
原文地址:https://www.cnblogs.com/della/p/3296141.html