I'm trying to avoid needing to provide a list of classes. I trying to
get the act of instantiating a class to trigger the loading of the
javascript for that class if the class isn't already defined.That way,
the dependencies automatically take care of themselves.

On Apr 6, 7:35 pm, Barry van Oudtshoorn <[email protected]>
wrote:
> Something along the lines of...
>
> window.addEvent('domready', function() {
>
> ['monkey', 'pony', 'lemur'].each(function(item) {
> if (!window[item]) {
> Asset.javascript('myLibrary/' + item + '.js', {
> onload: function() {
> window[item + 'inst'] = new window[item]();}
> });
> } else {
>
> window[item + 'inst'] = new window[item]();
>
> }
> });
> });
>
> Of course, that assumes that all of your classes are in the global
> namespace.
>
> - Barry
>
> - Show quoted text -


-- 
To unsubscribe, reply using "remove me" as the subject.

Reply via email to