function include(path){ 

    var a=document.createElement("script");
    a.type = "text/javascript"
    a.src=path; 
    var head=document.getElementsByTagName("head")[0];
    head.appendChild(a);
    }
 
可以在任何地方以
include("A.js");
include("../js/test.js");
等等来包含外部的js

相关文章:

  • 2021-12-13
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
  • 2021-11-21
猜你喜欢
  • 2022-02-09
  • 2021-12-01
  • 2021-11-21
  • 2022-03-02
  • 2021-09-29
  • 2021-11-21
相关资源
相似解决方案