Re: Browsers browsers



I wrote:
>> ...way to redefine a function, so that for example if I call
>> document.all
>> it gets interpreted as
>> document.getElementByID
>
> document.all is not a function, it is a collection. As a collection,
> the proper way to use it is with square brackets:
>
> document.all["myElement"].style.display = "none"

This was an incomplete utterance on my part. I meant to point out further
that document.getElementById is a method, and as such is called with
parentheses:

document.getElementById("myElement").style.display = "none"



So suppose you do something like this:

document.all = document.all || document.getElementById


What does the non-doc.all browser do when it sees this?

document.all["myElement"].style.display = "none"



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.


.



Relevant Pages

  • Re: Using Apostrophes in text boxes
    ... "Dave Anderson" wrote: ... > Unsolicited commercial email will be read at a cost of $500 per message. ... > of this email address implies consent to these terms. ... > question is worth asking, ...
    (microsoft.public.scripting.jscript)
  • Re: Converting hrs and min to just min
    ... > I am using two fields on a form to capture time someboby is working. ... Unsolicited commercial email will be read at a cost of $500 per message. ... Use of this email address implies consent to these terms. ... If your question is worth asking, ...
    (microsoft.public.inetserver.asp.general)
  • Re: Converting hrs and min to just min
    ... >> I am using two fields on a form to capture time someboby is working. ... > Unsolicited commercial email will be read at a cost of $500 per message. ... > of this email address implies consent to these terms. ... > question is worth asking, ...
    (microsoft.public.inetserver.asp.general)
  • Re: maximum Number object
    ... > Perhaps an enlightening exercise would be to find the largest ... Unsolicited commercial email will be read at a cost of $500 per message. ... Use of this email address implies consent to these terms. ... If your question is worth asking, ...
    (microsoft.public.scripting.jscript)
  • Re: Show if DB field NOT NULL
    ... >> Unsolicited commercial email will be read at a cost of $500 per message. ... >> of this email address implies consent to these terms. ... >> question is worth asking, ...
    (microsoft.public.inetserver.asp.general)

Loading