编程语言
首页 > 编程语言> > javascript – 我可以使用html5缓存清单存储第三方js吗?

javascript – 我可以使用html5缓存清单存储第三方js吗?

作者:互联网

我想在我的html5缓存清单中使用第三方js.
我不知道我能不能做到,如果可能的话怎么样?
我可以在清单文件中指定完整的第三方js url吗?
我已经看过一些例子,在清单中他们为图像指定了http url,那么为什么我们不能为js& CSS?
如果我们无法实现它,还有其他选择吗?我知道我们可以将第三方j存储在本地存储中.
示例表示赞赏.

解决方法:

根据html5doctors,您可以在缓存清单中设置外部URL.这是一个例子:

CACHE MANIFEST

# This is the cache part where you specify files to cache
CACHE
/some/file.js
/some/other/file.css

http://some.external.url/file.js

如果你想要更多的信息(缓存,后备等),我建议你阅读html5doctors的链接.

标签:javascript,html5,browser-cache,cache-manifest
来源: https://codeday.me/bug/20190530/1183066.html