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"]);
  • 相关阅读:
    WPF Style和Template
    WPF自定义命令
    Vue-cli proxyTable 解决开发环境的跨域问题
    mongoose 获取某个存在的collecion 里的数据
    express+mongodb+mongoose简单入门
    服务器环境配置nginx / php / php-fpm(一)
    vue 循环前十条数据
    nodejs express的基本用法
    nodejs querystring
    nodejs fs.readFile
  • 原文地址:https://www.cnblogs.com/della/p/3296141.html
Copyright © 2011-2022 走看看