Question/Problem: I have several js files (~15) with some functions. To not have to include them all one by one in the html page, I want to create an include file (like in php with include(), require(), etc).
Goal: So the goal is to have something like that:
HTML: Only src main.js or main.js + includes.js
Includes.js: Should get all the scripts.
Main.js: Should get access to all the includes.js scripts.
What I already tried:
$.getScript all the files in includes.js, src it in the html before main.js, and try to use the function in main.js, didn't work.
$.getScript all the files in includes.js,$.getScript includes.js in main.js, just src main.js, try to use the function in main.js, didn't work.
Same as above but also src includes.js before main.js, scripts run twice.
Appreciate any feedback, thanks.
PS: I already found these : loading multiple javascript files - jquery and these : How to include multiple js files using jQuery $.getScript() method, but they don't quiet well do want i'm looking for.