loading js files dynamically via another js file?

前端 未结 5 1870
慢半拍i
慢半拍i 2020-12-09 06:30

is there anyway to load other JS files from within a single JS file. I would like to point my individual pages \"ITS\" js file and that js file would load jquery, other js f

5条回答
  •  攒了一身酷
    2020-12-09 07:24

    This is similar to Darin's solution, except it doesn't make any variables.

    document.getElementsByTagName('head')[0].appendChild(document.createElement("script")).src = "helper.js";
    

提交回复
热议问题