After lots of google searching and reading this and then, I created a little function like this:
function includeScript(scriptName) { // Change requests to be sent synchronous $.ajaxSetup({ async: false }); // Loads and executes a local JavaScript file $.getScript("../../libs/" + scriptName + ".js"); // Restore requests to be sent asynchronous $.ajaxSetup({ async: true }); } What do you people think? Is this good? Or is there a better way to do this? On Feb 17, 1:30 am, Nazgulled <[EMAIL PROTECTED]> wrote: > Now you guys got me confused... > > Now I have getScript and the On-Demand plugin... which one is better? > Which one suits better what I want to do? (explained on the first > post) > > Though, I liked how the On-Demand was capable of loading css on run- > time too and that might prove useful when and if, for some reason, my > website needs specific IE CSS and I need to load that CSS file if the > user is using IE. However, I would really like to know the differences > between the two to include javascript files on run time... > > On Feb 16, 5:11 pm, Tony <[EMAIL PROTECTED]> wrote: > > > You can try the on-demand > > plugin:http://www.creativit.com.br/jquery/ondemand_js/index.htm > > > --Tony