怎样快捷获取网页的window对象

使用document.defaultView;

document.defaultView === window

 

注意: 

1. 如果当前文档不属于window对象, 则返回null;

2. document.defaulView 是 document 的快捷方式属性;

posted on 2019-09-17 00:34  aisowe  阅读(836)  评论(0编辑  收藏  举报

导航