aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/api/document/defaultview/index.html
blob: 317d072b4987fac8ac6a76297dcfc75a826c4067 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
title: Document.defaultView
slug: Web/API/Document/defaultView
translation_of: Web/API/Document/defaultView
---
<div>{{ApiRef}}</div>

<p>在瀏覽器中,<strong><code>document.defaultView</code></strong> 屬性會指向一個目前 {{Glossary("Browsing_context", "document")}} 所屬的 {{domxref("Window", "window")}} 物件,若無則為 <code>null</code></p>

<h2 id="語法">語法</h2>

<pre class="syntaxbox">var <var>win</var> = document.defaultView;</pre>

<p>此為唯讀屬性。</p>

<h2 id="規範">規範</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', '#dom-document-defaultview', 'Document.defaultView')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>No change</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'browsers.html#dom-document-defaultview', 'Document.defaultView')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="瀏覽器相容性">瀏覽器相容性</h2>

{{Compat("api.Document.defaultView")}}