1、window是javascript的顶级对象
       window有很多内置方法 如 alert open 自定义函数
2、window是bom的顶级对象,通常情况下,可以省略
window.alert()
alert()
成员变量也是windew的一个属性
var aaa=;
alert(aaa);
alert(window.aaa)
alert(aaa=== window.aaa)
自定义函数也是window的一个方法
function fn(){
console.log();
console.log();
}

3、关闭打开一个新窗口
        window.open()打开也窗口
var a1=document.getElementsByTagName("a")[];
var a2=document.getElementsByTagName("a")[];
a1.onclick=function(){
window.open("http://www.jd.com","_black")
};

window.close()关闭窗口

 a2.onclick = function () {
window.close();
}
windoe.location  相当于浏览器的地址栏
location对象属性
.location.href  ="跳转到的新网址" 页面跳转
var div=document.getElementsByTagName("div")[];
div.onclick=function(){
location.href="http://www.baidu.com"
}

userAgent属性可以获取用户端的一些信息

 //系统,浏览器
console.log(navigator.userAgent) //浏览器支持的系统
console.log(navigator.platform)
history对象 历史记录管理
history.go(-1)  heistory.bock()后退
var but=document.getElementsByTagName("button")[];
but.onclick=function () {
history.go(-)
}

history.go(1) 前进

 

最新文章

  1. UIAlertViewController的使用
  2. selenium隔离环境安装、以及示例
  3. eclipse/intellij Idea集成jetty
  4. JS简单加密
  5. Android Programming: Pushing the Limits -- Chapter 6: Services and Background Tasks
  6. 未能找到类型或命名空间名称“Coco”(是否缺少 using 指令或程序集引用)
  7. ZooKeeper启动过程2:FastLeaderElection
  8. 关于Viual Studio 改变编辑器背景背景及背景图片(转)
  9. 网上图书商城项目学习笔记-012BOOK模块查询2
  10. Express异步进化史
  11. 文本编辑工具vim
  12. 初探Google Guava
  13. leetcode — jump-game-ii
  14. ux.form.field.Month 只能选年、月的时间扩展
  15. RAD Studio August 2018 Roadmap
  16. C#语言经典例题
  17. [廖雪峰] Git 分支管理(3):分支管理策略
  18. 如何在Java 环境下使用 HTTP 协议收发 MQ 消息
  19. asp.net文件压缩,下载,物理路径,相对路径,删除文件
  20. Coredata — 入门使用

热门文章

  1. 08Dockerfile基本使用
  2. mysql 8.0.13开启远程连接 配置方式
  3. Lua的栈及基本栈操作
  4. S/4HANA中的销售计划管理
  5. Java动态追踪技术探究(动态修改)
  6. Oracle问题总结
  7. linux 下安装 jdk1.7
  8. (十二)A64
  9. 十九,基于helm搭建EFK日志收集系统
  10. 04_ Flume采集文件到HDFS案例