【发布时间】:2019-03-03 05:55:02
【问题描述】:
我有一个问题。我想像下面这样调用 HTML 文件。但它只能在 Google chrome 中工作。在 Mozila Firefox 中它根本不工作。
<link rel="import" href="controllerHTML/adminController.html">
adminController.html:
<script src="../controller/loginController.js" type="text/javascript"></script>
<script src="../controller/adminController.js" type="text/javascript"></script>
<script src="../controller/adminCollegeProfileController.js" type="text/javascript"></script>
<script src="../controller/adminResController.js" type="text/javascript"></script>
<script src="../controller/adminResourceUserRoleController.js" type="text/javascript"></script>
<script src="../controller/adminResourceClassController.js" type="text/javascript"></script>
这里我的要求是我需要在我的 index.html 的正文部分调用这个 adminController.html 文件。这个 adminController.html 文件包含一些动态包含的 js 链接。但它只在 Chrome 中工作。请帮我解决这个问题。
【问题讨论】:
-
您是否使用任何框架,如 AngularJS 或库,如 jQuery?还是您正在寻找香草 JS 中的解决方案?
-
@FelisCatus:我正在使用 angular.js。因为我有这么多控制器文件,我不想将所有文件都包含在索引页面中。我想通过保留在另一个页面中来调用它们。
-
在这种情况下,最好打开另一个问题,重点关注角度控制器动态加载和类似的东西,因为那将是一个完全不同的主题。让我们在这里继续讨论 HTML 导入。
-
好的,我会关注另一个问题。