aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/document/defaultview/index.html
blob: a54db93990f9f150b1329834934913cf9b16f609 (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
---
title: Document.defaultView
slug: Web/API/Document/defaultView
tags:
  - defaultView
translation_of: Web/API/Document/defaultView
---
<div>{{ ApiRef() }}</div>

<h3 id="Summary" name="Summary">概述</h3>

<p>在浏览器中,该属性返回当前 <code>document </code>对象所关联的 <code><a href="/zh-cn/DOM/window" title="zh-cn/DOM/window">window</a></code> 对象,如果没有,会返回 <code>null</code></p>

<h3 id="Syntax" name="Syntax">语法</h3>

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

<p>该属性只读.</p>

<h3 id="Notes" name="Notes">备注</h3>

<p>根据 <a class="external" href="http://www.quirksmode.org/dom/w3c_html.html" title="http://www.quirksmode.org/dom/w3c_html.html">quirksmode</a>,IE 9 以下版本不支持 <code>defaultView</code></p>

<h3 id="Specification" name="Specification">规范</h3>

<ul>
 <li><a href="/zh-cn/HTML/HTML5" title="zh-cn/HTML/HTML5">HTML5: defaultView</a></li>
 <li><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-DocumentView-defaultView">DOM Level 2 Views: defaultView</a></li>
 <li><a class="external" href="http://www.w3.org/TR/DOM-Level-3-Views/" title="http://www.w3.org/TR/DOM-Level-3-Views/">DOM Level 3 Views</a> (Only developed to Working Group Note and not implemented)</li>
</ul>

<p>{{ languages( {"pl": "pl/DOM/document.defaultView","en": "en/DOM/document.defaultView" } ) }}</p>