[thelist] Variables and the DOM

Peter-Paul Koch gassinaumasis at hotmail.com
Wed Oct 10 07:29:28 CDT 2001


>From: "The Optimizer" <chrism at puffofsmoke.net>
>Reply-To: thelist at lists.evolt.org
>To: <thelist at lists.evolt.org>
>Subject: RE: [thelist] Variables and the DOM
>Date: Wed, 10 Oct 2001 13:19:29 +0100

> > This works. objDOM now has become a reference to
> > document.forms[0] so that
> > you can do everything with it you can do with document.forms[0]
>
>This is what I thought. However, when I click on the link in the following
>HTML page, I get the error "'objForm.elements' is not an object":
>
><html>
><head>
><title>Test</title>
><script>
>var objForm = document.forms[0];

You execute this directly while the page is loading. The forms array is only 
formed when the page has *finished* loading. Put this line in an init() 
function instead and call it onLoad.

ppk

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





More information about the thelist mailing list