I have a question and I don't know if it is possible to do that.
I have multiple files in .js who are in the same system (each function of every files is available inside the other files).
script_A.js
script_B.js
script_C.js
script_D.js
Inside my script_A.js
I have a function loadAllFunction()
and inside this function I put some function of the script_B.js, script_C.js and script_D.js
that I want to load by default when I call loadAllFunction()
.
So all works well like this but I am asking if it is possible to push the function I want inside loadAllFunction()
directly since the files script_B.js, script_C.js and script_D.js
?
Something like for exemple :
script_B.js
:
function loadScriptB() {....}
loadAllFunction(loadScriptB());
script_C.js
:
function loadScriptC() {....}
loadAllFunction(loadScriptC());
script_D.js
:
function loadScriptD() {....}
loadAllFunction(loadScriptD());
And then I call loadAllFunction()
from my script_A.js
for load all.
It is possible to do something like this ?
Thanks