缓存js / css资源以使我的项目脱机工作
I have been given a project (web application) to work, which depends on many online js/css resources (e.g. jquery <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
)
我有一个项目(Web应用程序)可以工作,这取决于许多在线js / css资源(例如jquery
There are a lot of them in my html templates in various places. Is there any way (even a firefox plugin) that would let me download them (or cache them locally, in some way) so I can work offline?
我的html模板中有很多在不同的地方。有没有办法(甚至是一个firefox插件)让我下载它们(或以某种方式在本地缓存它们)所以我可以脱机工作?
I have to be away in a place without internet access and I have to take my laptop with me.
我必须离开一个没有互联网接入的地方,我必须带着我的笔记本电脑。
1 个解决方案
#1
1
Look at Basket.js:
看看Basket.js:
a script and resource loader for caching and loading scripts using localStorage
用于使用localStorage缓存和加载脚本的脚本和资源加载器
It can also cache CSS.
它还可以缓存CSS。
Example:
basket
.require({ url: 'missing.js' })
.then(function () {
// Success
}, function (error) {
// There was an error fetching the script
console.log(error);
});
更多相关文章
- HTML5 的应用程序缓存和优势
- 通过脚本自动屏蔽非法IP(转http://bbs.5y6s.com/htm_data/21/080
- Apache服务器压缩和利用浏览缓存问题
- PHP通过系统命令执行Python脚本
- PHP邮件脚本占用了大量资源
- thinkphp框架里怎么用linux的crontab写php的定时脚本
- 锁定表是否可以通过包含的脚本访问
- 确定脚本所在的服务器以及PHP中的配置的最佳方法是什么?
- PHPExcel导入导出及大量数据导入缓存方式的修改