Load external js file with jQuery

前端 未结 3 1049
醉酒成梦
醉酒成梦 2021-01-14 01:48

Looked for it everywhere, and found the answer but lost. anyone knows how to load an external .js file from another js file?

main_lobj1.onreadystatechange =          


        
3条回答
  •  无人共我
    2021-01-14 02:40

    This is the way you can do it to load an external js file to Jquery

    $.ajax({
      type: "GET",
      url: "test.js",
      dataType: "script"
    });
    

提交回复
热议问题