【发布时间】:2015-01-14 13:17:55
【问题描述】:
我有一个需要在离线模式下工作的应用程序。但是,只有部分应用程序需要在离线模式下工作。
我很好地处理来自用户的输入和操作 - 我让用户知道哪些操作在离线模式下不可用。
我的问题在于缓存清单的条目
假设我的 index.html 文件看起来像这样 -
<html manifest="/cache.manifest">
<body>
<script src="FirstController.js"></script>
<script src="SecondController.js"></script>
</body>
</html>
现在,我只需要FirstController.js 文件,因为在离线模式下只需要它处理的页面。所以我在缓存清单中指定它。
这行得通。但是,我注意到浏览器仍在尝试加载SecondController.js 文件。
因此,我的应用程序无法在 IE11 中加载。在 Google Chrome 中,我在控制台中有错误。 (这是离线模式)。
如果应用程序离线,我如何告诉浏览器忽略SecondController.js?
【问题讨论】:
标签: html cache-manifest