How quickly get the window object of the page

Use document.defaultView;

document.defaultView === window

 

note: 

1. If you do not belong to the current document window object, then return null;

2. document.defaulView is a shortcut to the document attribute;

Guess you like

Origin www.cnblogs.com/aisowe/p/11531196.html