[WSG] getElementById() always returns null

2005-12-05 Thread Chris Lamberson
Through foresight, i already know this will be a very pitiful question to real web designers, so bear with me.I was having some trouble finding out why, whenever I call for document.getElementById(id), it returns null (even if there is a valid id-matching element). Consider something simple, like

Re: [WSG] getElementById() always returns null

2005-12-05 Thread Ben Wong
It's because the code is being executed before the tags with the matching ids are created. On 12/6/05, Chris Lamberson <[EMAIL PROTECTED]> wrote: > Through foresight, i already know this will be a very pitiful question to > real web designers, so bear with me. > > I was having some trouble finding

RE: [WSG] getElementById() always returns null

2005-12-05 Thread Smith, Eric E \(EM, PTL, Kelly Services, Contractor\)
gt;On Behalf Of </B>Chris Lamberson<BR><B>Sent:</B> Monday, December 05, 2005 7:58 PM<BR><B>To:</B> wsg@webstandardsgroup.org<BR><B>Subject:</B> [WSG] getElementById() always returns null<BR><BR></FONT></DIV><SPA

Re: [WSG] getElementById() always returns null

2005-12-05 Thread Bert Doorn
G'day I was having some trouble finding out why, whenever I call for document.getElementById(id), it returns null (even if there is a valid id-matching element). Consider something simple, like this: The javascript runs as the page loads. At that point, the elements with the ids do not yet ex

Re: [WSG] getElementById() always returns null

2005-12-05 Thread Alan Trick
What browser are you using? That should work on most of them, but Internet Explorer has a mis-feature were it does something really wierd. I think what it does is assigns elements with id's to variables with the id's name. I'm not sure though, I haven't tested it out enough. The consequence thoug

Re: [WSG] getElementById() always returns null

2005-12-05 Thread Alan Trick
Nevermind, ignore what I said, Bert is right. Although IE may misbehave as well, it seems pretty inconsitent and buggy. On Tue, 2005-12-06 at 09:21 +0800, Bert Doorn wrote: > G'day > > > I was having some trouble finding out why, whenever I call for > > document.getElementById(id), it returns nul

Re: [WSG] getElementById() always returns null

2005-12-05 Thread Felix Miata
Chris Lamberson wrote: I think that's the problem I had on both http://members.ij.net/mrmazda/tmp/dpi-broken.html and http://members.ij.net/mrmazda/auth/dpi-screen-window.html in certain development builds of Gecko recently until I got some help with a workaround now found in the latter but not th

Re: [WSG] getElementById() always returns null

2005-12-06 Thread malla reddy
Dear All, Let you know why this problem is coming. Actually I am a bit busy with my work, if not I would have sent the cause. Regards, Malla --- Ben Wong <[EMAIL PROTECTED]> wrote: > It's because the code is being executed before the > tags with the > matching ids are created. > > On 12/6/05,

Re: [WSG] getElementById() always returns null

2005-12-07 Thread Roberto Gorjão
Hi Chris, As JavaScript isn't a precompiled language (rather a scripting one), functions, objects and variables are processed one after another, following the source order. When you declare your variables, the browser is not yet aware of the existence of the two requested elements. You have s