== 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 ===
Exception encountered, of type "Error"
[6a63c8f2] /index.php?diff=next&oldid=6959&title=JavaScript_Document_Object Error from line 434 of /var/www/techotopia/includes/diff/DairikiDiff.php: Call to undefined function each()
Backtrace:
#0 /var/www/techotopia/includes/diff/DairikiDiff.php(544): DiffEngine->diag()
#1 /var/www/techotopia/includes/diff/DairikiDiff.php(344): DiffEngine->compareSeq()
#2 /var/www/techotopia/includes/diff/DairikiDiff.php(227): DiffEngine->diffLocal()
#3 /var/www/techotopia/includes/diff/DairikiDiff.php(721): DiffEngine->diff()
#4 /var/www/techotopia/includes/diff/DairikiDiff.php(859): Diff->__construct()
#5 /var/www/techotopia/includes/diff/DairikiDiff.php(980): MappedDiff->__construct()
#6 /var/www/techotopia/includes/diff/TableDiffFormatter.php(194): WordLevelDiff->__construct()
#7 /var/www/techotopia/includes/diff/DiffFormatter.php(140): TableDiffFormatter->changed()
#8 /var/www/techotopia/includes/diff/DiffFormatter.php(82): DiffFormatter->block()
#9 /var/www/techotopia/includes/diff/DifferenceEngine.php(881): DiffFormatter->format()
#10 /var/www/techotopia/includes/diff/DifferenceEngine.php(797): DifferenceEngine->generateTextDiffBody()
#11 /var/www/techotopia/includes/diff/DifferenceEngine.php(728): DifferenceEngine->generateContentDiffBody()
#12 /var/www/techotopia/includes/diff/DifferenceEngine.php(662): DifferenceEngine->getDiffBody()
#13 /var/www/techotopia/includes/diff/DifferenceEngine.php(632): DifferenceEngine->getDiff()
#14 /var/www/techotopia/includes/diff/DifferenceEngine.php(453): DifferenceEngine->showDiff()
#15 /var/www/techotopia/includes/page/Article.php(797): DifferenceEngine->showDiffPage()
#16 /var/www/techotopia/includes/page/Article.php(508): Article->showDiffPage()
#17 /var/www/techotopia/includes/actions/ViewAction.php(44): Article->view()
#18 /var/www/techotopia/includes/MediaWiki.php(490): ViewAction->show()
#19 /var/www/techotopia/includes/MediaWiki.php(287): MediaWiki->performAction()
#20 /var/www/techotopia/includes/MediaWiki.php(714): MediaWiki->performRequest()
#21 /var/www/techotopia/includes/MediaWiki.php(508): MediaWiki->main()
#22 /var/www/techotopia/index.php(41): MediaWiki->run()
#23 {main}