javascript - Call .js file from another .js file -
I have a javascript program in my module; The statement is how can I do this in javascript? test1.js in it
if..ELSEIF is my challenge that I differ based on the conditions located in the
IF-ELSE statement I want to call the
.js programs.
TEST1.js looks -
----- if (Kando1) wants to call {// test2.js} }} And if (kando 2) {// want to call test3.js}
if (cond1) {// test2.js want to call here var js = document.createElement ("script"); JSTP = "Text / JavaScript"; Js.src = "test2.js"; document.body.appendChild (js); } Else if (cond2) {// test3.js would like to call here var js = document.createElement ("script"); js.type = "text / javascript"; Js.src = "test3.js"; document.body.appendChild (js); }
Comments
Post a Comment