javascript - Call .js file from another .js file -


I have a javascript program in my module; The statement is 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}   

how can I do this in javascript?

  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

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -