Document.defaultView

  • Revision slug: DOM/document.defaultView
  • Revision title: document.defaultView
  • Revision id: 11027
  • Created:
  • Creator: ziyunfei
  • Is current revision? No
  • Comment 16 words added, 2 words removed

Revision Content

Summary

In browsers returns the window object associated with the document or null if none available.

Syntax

var win = document.defaultView;

This property is read-only.

Notes

According to quirksmode, defaultView is not supported in IE until IE 9.

Specification

{{ languages( {"pl": "pl/DOM/document.defaultView","zh-cn": "zh-cn/DOM/document.defaultView" } ) }}

Revision Source

<h3 id="Summary" name="Summary">Summary</h3>
<p>In browsers returns the <a href="/en/DOM/window" title="en/DOM/window">window</a> object associated with the document or <code>null</code> if none available.</p>
<h3 id="Syntax" name="Syntax">Syntax</h3>
<pre class="eval">var win = document.defaultView;
</pre>
<p>This property is read-only.</p>
<h3 id="Notes" name="Notes">Notes</h3>
<p>According to <a class="external" href="http://www.quirksmode.org/dom/w3c_html.html" title="http://www.quirksmode.org/dom/w3c_html.html">quirksmode</a>, <code>defaultView</code> is not supported in IE until IE 9.</p>
<h3 id="Specification" name="Specification">Specification</h3>
<ul> <li><a href="/en/HTML/HTML5" title="en/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","zh-cn": "zh-cn/DOM/document.defaultView" } ) }}</p>
Revert to this revision