Rivotti said the following on 11/12/2007 6:14 PM:
URL: http://www.stekolla.com/articles/ondemand.php
Just when I thought I had seen the worst approach to trying to
dynamically load a JS File I see that one.
can someone enlighten me as to how his approach solves dependencies ?
It doesn't, all by itself.
I have included:
try {
var t = new DependecyObject();
} catch (e) {
eval(LoadJSFile('dependencymodule.js', true));
}
try, catch and eval all in one block. Ewwwww. Since LoadJSFile doesn't
return anything other than ''(possibly but not always), then I don't see
a lot of sense in eval'ing it. The file it is trying to load will get
executed.
i a few of my functions and i am not sure if above functions should be
placed in one file or in each individual files. Can someone please
enlighten me ?
Maybe you should try asking Steve about Steve's code.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -
http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/