zoukankan      html  css  js  c++  java
  • javascript高级程序设计第8章

    window对象

    Window 对象表示浏览器中打开的窗口 全局作用域

    • 窗口关系以及框架 window.fames
    • 窗口位置 window.screen window.screenLeft window.screenTop
    • 窗口大小 window.innerWidth window.innerHeight
    • 导航和打开窗口 window.open

     

    window.open("http://www.runoob.com","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400");
    url,target,feture

    • setTimeout
    • setInterval
    • 系统对话框 alert() confirm() prompt()

     

    location对象 最有用的BOM对象

    常用于获取url参数
    function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
    var r = decodeURI(window.location.search).substr(1).match(reg); //匹配目标参数
    if (r != null) return unescape(r[2]); //返回参数值
    }

    navigator对象 用于检测浏览器类型

    screen对象

    history对象 不常用对象

    客户端存储数据

    • localStorage 没有时间限制

    localStorage.setItem() 存储
    localStorage.getItem() 取值
    localStorage.clear() 清空

    • sessionStorage 浏览器关闭之后 数据会被删除

  • 相关阅读:
    20180130工作总结
    高并发情况利用锁机制处理缓存未命中
    Git学习(二)
    Git学习(一)
    Navicat运行sql文件报错out of memory
    Windows中杀死某个端口的进程
    Git入门基本操作
    MySQL数据库安装与配置详解
    用户模块开发
    数据库系列学习(三)-数据的增、删、改
  • 原文地址:https://www.cnblogs.com/joyce123/p/10848041.html
Copyright © 2011-2022 走看看