Javascript Reference
Categories: document

javascript document defaultView

@Aug. 15, 2009, 11:57 a.m.
defaultView Firefox/Netscape/NN 6 IE n/a Chrome/Safari/DOM 2

 

Read-only

Returns a reference to the W3C DOM abstract representation of a "viewer" that renders the document (the formal name for the object is AbstractView). In Netscape 6, this object equates to the window or frame object that contains the document. A script function that has access to a document object (such as via the element object's ownerDocument property) can obtain a valid reference to the document's window via this defaultView property. The document's view includes knowledge about cascaded style rules applied to each element. See the description of obtaining the effective style of an element with the help of the document.defaultView property and the getComputedStyle( ) method.

 

This is as close as the W3C DOM Level 2 comes to acknowledging the existence of a window object. More is to come in Level 3.

 
Example
 
var theWin = elemRef.ownerDocument.defaultView;
 
Value

Reference to a window object.

 
Default

The document's window.

Hello gakaa.com administrator, Your posts are always well-referenced and credible.
Florrie Broadnax - 3 days
very useful descriptions and explanations. Thanks!
proglammer - 2010-01-15

Powered by Linode.