== JavaScript Document Object Methods and Properties ==
== JavaScript Document Object Methods and Properties ==
−
The JavaScript Document contains a wide range of methods and properties that are considerable use to developers. The following table lists the key methods and properties provided by the Document object:
+
The JavaScript Document contains a wide range of methods and properties that are of considerable use to developers. The following table lists the key methods and properties provided by the Document object:
=== Document Object Methods ===
=== Document Object Methods ===
<td>fgColor<td>The foreground color (i.e. the color of the text in the document)</td>
<td>fgColor<td>The foreground color (i.e. the color of the text in the document)</td>
<tr>
<tr>
−
<td>cookie<td>The cookie, if aany, assosiated with the document. See [[Understanding JavaScript Cookies]]</td>
+
<td>cookie<td>The cookie, if any, associated with the document. See [[Understanding JavaScript Cookies]]</td>
<tr>
<tr>
<td>domain<td>The current domain of the document</td>
<td>domain<td>The current domain of the document</td>
<td>referrer<td>The URL of the document from which the current document was linked (i.e. how the visitor arrived at this page)</td>
<td>referrer<td>The URL of the document from which the current document was linked (i.e. how the visitor arrived at this page)</td>
<tr>
<tr>
−
<td>title<td>The title of the docuemnt (corresponds to the HTML ''<title>'' tag)</td>
+
<td>title<td>The title of the document (corresponds to the HTML ''<title>'' tag)</td>
<tr>
<tr>
<td>URL<td>The URL of the current document</td>
<td>URL<td>The URL of the current document</td>
== Using the JavaScript Document Object ==
== Using the JavaScript Document Object ==
−
Now that we have seen the methods and properties that are avialable with the Document object we can begin explore how to use them:
+
Now that we have seen the methods and properties that are available with the Document object we can begin explore how to use them:
=== Writing text to a document ===
=== Writing text to a document ===
−
The document object ''open()'' and ''write()'' methods can be used to dynamically write text to a web page. The following example contains both some text contained in the HTML file, togetehr with some JavaScript to write additional text into the page:
+
The document object ''open()'' and ''write()'' methods can be used to dynamically write text to a web page. The following example contains both some text contained in the HTML file, together with some JavaScript to write additional text into the page:
<pre>
<pre>
=== Writing Text to a document in a different Window ===
=== Writing Text to a document in a different Window ===