[Javascript] Error: missing name after . operator

Laurent Muchacho elmuchacho at gmail.com
Fri Oct 28 13:07:00 CDT 2005


Hi

yes you right sorry if my email might have sounded a bit direct, english is 
neither my mother tongue.

Now to get back to the initial question.
Did a bit of research and the error appear in firefox for me too and return 
the same error
Mainly doing "document.forms[0].Interface.value" is not best practice but it 
should work then I remember the reserved javascript word et voila interface 
is a reserved keyword
found below a url who list them
http://javascript.about.com/library/blreserved.htm
But at my big surprised document is not a reserved word, Oh and using "top" 
for a function name, will cause you some problem on Mac safari (it took me a 
while to work that one out believe me you will remember interface from now 
on :-)

Then I try this just changed the word interface to Interface

<form>
<input type="hidden" name="Interface">
</form>
<script type="text/javascript">
alert(document.forms[0].Interface.value)
</script>

and it work fine

Regards

Laurent

----- Original Message ----- 
From: "diego nunes" <dnunes at gmail.com>
To: "[JavaScript List]" <javascript at latech.edu>
Sent: Friday, October 28, 2005 5:31 PM
Subject: Re: [Javascript] Error: missing name after . operator


On 28/10/05, Laurent Muchacho <elmuchacho at gmail.com> wrote:
> I disagree with your statement, The form collection object was here since
> the begining and all browser support it.

   I'm complaining about the use of neither "form" nor "elements"
collection. I'm just stating the using
"document.NAME_OF_FORM.NAME_OF_ELEMENT" is totally wrong, since the
"document" object shouldn't have a property named as the form -- nor
the form should have properties named as the elements.
    Sorry if I wasn't clear -- my English is not that good.

--
diego nunes
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript 




More information about the Javascript mailing list