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

語法

var win = document.defaultView;

此為唯讀屬性。

規範

Specification Status Comment
HTML Living Standard
The definition of 'Document.defaultView' in that specification.
Living Standard No change
HTML5
The definition of 'Document.defaultView' in that specification.
Recommendation Initial definition

瀏覽器相容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

  
Feature Firefox (Gecko) Chrome Edge Internet Explorer Edge Opera Safari
Basic support (Yes) (Yes) (Yes) 9.0 0.10 (Yes) (Yes)
Feature Firefox Mobile (Gecko) Android Edge IE Mobile Opera Mobile Safari Mobile
Basic support ? ? ? ? ? ?

文件標籤與貢獻者

此頁面的貢獻者: jackblackevo
最近更新: jackblackevo,