nodebook/20191009/20191009.md
2019-10-13 14:11:30 +08:00

33 lines
1011 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 20191009
![js](https://img.shields.io/badge/language-js-orange.svg)
* window
* 所有变量属于window
* name,top 属于window自有属性不可声明
* 属性以及方法`<window.>functionName`可以省略window
* `window.confirm();`模态框返回Boolean
* `window.promit('str',defaultStr);`输入框返回str
* `window.onload` 页面加载完成事件
* `window.onunload` 页面关闭之后
* `window.onbeforeunload` 页面关闭之前
* BOM
* location
* href 页面跳转
* hash 地址#后边的内容
* host 主机和端口号
* hostname 主机名
* pathname 文件路径(相对路径)
* port 端口
* protocol 协议
* search ?后边的内容(参数)
* `assign(<hrefStr>)` 跳转页面方法
* `replace(<hrefStr>)` 无记录跳转
* reload 重载
* history
* `go(<number>)` 页面跳转`<number>`
* `back()` 回退
* `forward()` 前进