On May 15, 12:45 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
Quote:
Geoffrey Summerhayes a écrit :
>
Quote:
On May 15, 11:31 am, libsfan01 <mcyi2...@googlemail.comwrote:
Quote:
in firefox the following alert does not get created from my function:
>
Quote:
Quote:
ch = container1.childNodes(0).id;
alert(ch)
>
Quote:
Quote:
can anyone tell why this might not work in firefox but does in safari?
>
Why it could work in Safary I don't know,
but why it doesn't work in FF :
because the first chidNode in FF is an invisible text node (without id)
and anyway ... it is :
>
ch = container1.childNodes[0];
Actually the absence of id wouldn't cause a problem for this,
FF would show 'undefined' in the alert box. Round brackets
as opposed to square definitely are the culprit.
Quote:
Quote:
Are you getting an error in the console?
>
He can also have a look in Firefox's DOM inspector ( #text )
Depends a lot on what container1 is, a text node isn't always
the first child.
But it's always a good idea to learn to use the tools that are
there to make the job easier.
---
Geoff