I get the testFile.js filename from url parameters, so it is loaded dynamically.
Then i do:
<script>jQuery.getScript('testFolder/testFile.js');</script>
<script src="ok1.js" type="text/javascript" charset="UTF-8"> </script>
<script src="ok2.js" type="text/javascript" charset="UTF-8"> </script>
testFile.js has:
function getFile0(){}
ok1.js has:
function getFile1(){}
function getFile2(){}
function getFile3(){}
ok2.js has:
var _getFiles = [getFile0(), getFile1(), getFile2(), getFile2()];
Although, it is supposed to load first the testFile.js, then ok1.js and finally ok2.js, i get this error for ok2.js: Uncaught ReferenceError: getFile0 is not defined
I have tried plenty of stuff like:
jQuery.getScript('testFolder/testFile.js').done(function() {
jQuery.getScript('ok1.js').done(function() {
jQuery.getScript('ok2.js');
});
});
it is loading without error, but the page is not working as it should.