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;
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;