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

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

问题描述:



我想在我的html5缓存清单中使用第三方js。

我不知道我能不能这样做,如果有可能那么怎么办? br>
我可以在清单文件中指定完整的第三方js url吗?

我看过清单中的示例,他们为图像指定了http url,那么为什么我们不能为js做同样的事情&安培; css?

如果我们无法实现它,还有其他选择吗?我知道我们可以将第三方j存储在本地存储中。

示例表示赞赏。


I want to use third party js in my html5 cache manifest.
I don't know can I do it or not , if its possible then how?
Can I specify full third party js url in manifest file?
I have seen examples where in manifest they have specified http url for images , So why can't we do same for js & css?
If we can't implement it , is there any other option? I know that we can store third party js in local storage.
Example is appreciated.

根据 html5doctors ,您可以在缓存清单中设置外部网址。下面是一个示例:

According to html5doctors, you can set external urls in the cache manifest. Here is an example:

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的链接。

I suggest you read the link to html5doctors if you want more information (cache, fallback, etc).