To call all js files in just one line on my header I am currently using
function alljs(jsfile) {
var src = document.createElement("script");
src.setAttribute("type", "text/javascript");
src.setAttribute("src", jsfile);
document.getElementsByTagName("head")[0].appendChild(src);
}
alljs("path/to/my/jsfile1.js");
alljs("path/to/my/jsfile2.js");
alljs("path/to/my/jsfile3.js");
then all I have to do is put this on my header:
<script type="text/javascript" src="my/path/all.js" ></script>
but recently I have to include jquery files in my system I notice that calling a jquery file by adding
alljs("path/to/my/jqueryfile1.js");
to my all.js file doesn't work...
I have to do a second line of <script>
on my header just to call the jquery file...
My question is: is there a similar way to call all jquery files in just one file?