Visit Mozilla.org

DOM:window.document

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

Returns a reference to the document contained in the window.

Note: New in Firefox 3 Firefox 3 alters the security for windows' documents so that only the domain from which it was located can access the document. While this may break some existing sites, it's a move made by both Firefox 3 and Internet Explorer 7, and results in improved security.

[edit] Syntax

doc = window.document 

[edit] Parameters

  • doc is an object reference to a document.

[edit] Example

<html>
<head>
   <title>Hello, World!</title>
</head>
<body>

<script type="text/javascript">
   var doc = window.document;
   alert( doc.title);    // alerts: Hello, World!
</script>

</body>
</html>

[edit] Specification

DOM Level 0. Not part of any standard.