[thelist] [JavaScript] event location issue restated

Tom Dell'Aringa pixelmech at yahoo.com
Wed Feb 22 12:54:10 CST 2006


--- Matt Warden <mwarden at gmail.com> wrote:
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>><><><><><><>
> If you return from myFunc as soon as you realize the element(s) you're
> trying to init are not on that page, then there really aren't many
> cycles lost. e.g.: <snip>
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>><><><><><><>

That's very true... don't know why I didn't think of that.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>><><><><><><>
> Personally, I move code like this into external javascript files and
> include them only when necessary. Prereq/dependency files are the ones I
> always include (like data structures, the event handling functions like
> addBodyOnload, my ajax utility class, etc.).
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>><><><><><><>

That's a good middle ground solution actually. So it doesn't matter that different script files
loaded at different times call the addBodyOnload() - they will still queue up no problem with
stepping on each other? If so that's great and I think I'll do that.

Thanks

Tom

http://www.pixelmech.com/
http://www.crossandthrone.com/


Professor Rumford: 'But I still don't understand about hyperspace.' 
The Doctor: 'Well, who does?' 
K9: 'I do.' 
Doctor: 'Shut up, K9!' 





More information about the thelist mailing list