首页 > 解决方案 > 有没有办法在 index.html 中包含所有外部 js 文件和脚本标签

问题描述

我想包含所有保存在 index.html 中某个文件夹中的 .js 文件。有没有办法在一个脚本标签中导入所有 .js 文件。就像我们用 * 导入包中的所有类一样

src
  Controller
  | HomeController.js
  | LoginController.js
  | AboutController.js
  Directive
  Services
  Views
index.html

索引.html

<html>
  <head>
     <script src='Controller/*.js'>
  </head>
  <body>

  </body>
</html>

我们可以在 index.html 中包含所有带有一个脚本标记的 .js 文件吗?

或者

有没有其他方法可以动态包含这些所有 js 文件?

标签: javascripthtmlexternal-js

解决方案


推荐阅读