0x01 Document对象
当浏览器载入一个HTML文档时,它就变成了document对象。
document对象是window对象的属性,可以用window.document来访问
0x02 常用对象属性
- document.baseURI - 返回网页的绝对URL(IE不支持)
- document.URL - 返回网页的URL
- document.cookie - 返回cookie
- document.body - 返回文档body元素
- docuemnt.referrer - 返回载入当前文档的文档的 URL
- document.location - 返回当前文档的URL
0x03 常用对象方法
- document.write() - 向文档中写东西
- document.writeln() - 跟document.write()一个功能,只不过每次写的时候都会加一个\n
- document.attachEvent() - 事件绑定,仅支持IE浏览器
- document.addEventListener() - 事件绑定,支持所有浏览器
- document.execCommand() - 处理HTML数据
- document.open() - 打开一个输出流,用来收集document.write()和document.writeln()的输出的内容

