[thelist] Javascript: Global variables in external .js?

Frank lists at frankmarion.com
Sat Mar 8 18:51:01 CST 2003


At 03:29 PM 3/8/2003 -0800, you wrote:
>Unfortunately, they're also going to be meaningless since at the
>time these particular examples are defined, the body hasn't been
>written and the elements you're referencing don't exist. :-)


Ah! <slaps forehead>

Now that you point it out, it's absurdly obvious.

Here is a puzzle though;

window.onload=init(); will indeed run the init() function, but will not
allow the other functions to share the variables but this.onload=init(); does.

I have no idea why. Do you?




More information about the thelist mailing list