[Javascript] looping through nodeList
Anthony Ettinger
apwebdesign at yahoo.com
Tue Oct 18 15:34:57 CDT 2005
--- Paul Novitski <paul at novitskisoftware.com> wrote:
> At 12:55 PM 10/18/2005, Anthony Ettinger wrote:
> >window.onload=Name();
> >
> >Needs to be without the ()'s:
> >
> >window.onload=Name;
> >
> >..which makes sense, since you wouldn't be passing
> >parameters from anywhere on the initial routine
> call.
>
>
> The way I think of this:
>
> window.onload = DoSomething;
>
> is that the entire text of the function
> DoSomething() is copied to
> the window.onload "variable." If you then execute:
>
> alert(window.onload);
>
> you'll see the DoSomething() function script there
> in its entirety.
>
> One interesting ramification of this (which I've
> played with in other
> languages but never in javascript) is the
> feasibility of parsing and
> modifying function code stored in a variable. For
> example, a
> function can edit a copy of itself and then call
> this revised form of
> itself. Nasty-fun wrinkle on recursion! Those
> kinds of games can
> produce program code that's incredibly difficult to
> maintain, but
> it's fun to play with nonetheless.
>
Haa...nice.
Any input on this? I basically am rewriting mailto:,
removing the non-working @.
accessible, but doesn't work unless user changes the @
manually. I've seen the html entity solution, but
seems rather easy to defeat to me. Would only have to
convert entities back into symbols.
ie - using . and @
Anthony Ettinger
ph: (408) 656-2473
web: http://www.apwebdesign.com
More information about the Javascript
mailing list