• 《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"]);
  • 相关阅读:
    文学、哲学段子
    文学、哲学段子
    js技术要点---JS 获取网页源代码
    泛型类,泛型方法,泛型委托的定义方法
    数组元素的逆序数
    stm32 ARM中的RO、RW和ZI DATA
    poj 3040 Allowance 贪心
    schedule()函数的调用时机(周期性调度)
    以JTextPanel为例Swing的鼠标事件详解
    实习生面试总结
  • 原文地址:https://www.cnblogs.com/della/p/3296141.html
Copyright © 2020-2023  润新知