Document.defaultView

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

在瀏覽器中,document.defaultView 屬性會指向一個目前 document 所屬的 window 物件,若無則為 null

語法

var win = document.defaultView;

此為唯讀屬性。

規範

Specification
HTML Standard
# dom-document-defaultview-dev

瀏覽器相容性

BCD tables only load in the browser