我可以使用html5缓存清单来存储第三方js吗? [英] Can I use html5 cache manifest to store third party js?

查看:145
本文介绍了我可以使用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).

这篇关于我可以使用html5缓存清单来存储第三方js吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆