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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -