I fund this excelent post about including js file in each other How do I include a JavaScript file in another JavaScript file?
and would like to use the jq suggestion
client is using mootools and jquery libraries and currently has multiple JS files loading in head due to all plugins and libs (10 files) . I was able to compress all this in 2 files I have 1 file that is loading mootools , jquery, and Mootools plugins , another file that is running the mootools functions.
so the order is this
compressed.js
moofunctions.js
now dependiong on what page you are on , we are loading additional jq plugins so the order changes to
compressed.js
moofunctions.js
requested_jquery_plugin.js
so the questions I have are:
do you see an implication with $.getScript() jq function ?
since $.getScript() is actually loading additional script via ajax , is this script seen as http request or will my request come down to 1 js file? ( answered with FB, only 1 js request seen )
the order in which the libs and plugins are compressed is in file 1 (compressed.js)
mootools lib, jquery lib , mootools plugins,
at the end of this file I included
(function($){
$.getScript("moofunctions.js", function(){
console.log("Script loaded and executed.");
});
})(jQuery);
do you see an implication with this?
any help is appreciated. Please don't advise/ask to use only 1 lib. Thnx!