使用HTML5缓存时无法加载外部资源
External resources fail to load when using HTML5 cache
我正在尝试让应用程序缓存工作:
CACHE MANIFEST
/css/style.css
/js/colors.js
/js/dropzone.js
/js/jquery.min.js
/js/script.js
/img/icon_analytics.png
/img/icon_exit.png
/img/icon_expand.png
/img/icon_list.png
/img/icon_lock.png
/img/icon_menu.png
/img/icon_more_content.png
/img/icon_settings.png
/img/icon_settings_black.png
/img/svg_icons/close_fullscreen.svg
/img/svg_icons/go_fullscreen.svg
/img/loader.gif
但我在控制台上得到的是:
GET https://www.google.com/jsapi net::ERR_FAILED
(index):517 Uncaught ReferenceError: google is not defined
(index):524 GET http://www.google-analytics.com/analytics.js net::ERR_FAILED
0.s3.envato.com/files/115114837/profile.jpg:1 GET https://0.s3.envato.com/files/115114837/profile.jpg net::ERR_FAILED
jquery.min.js:3 GET http://fonts.gstatic.com/s/roboto/v15/mnpfi9pxYH-Go5UiibESIpBw1xU1rKptJj_0jans920.woff2 net::ERR_FAILED
显然,它拒绝加载.appcache文件中未指定的任何资源。我甚至试图只指定图像,但它仍然会为样式表和所有.js文件抛出错误。
怎么回事?
您需要添加NETWORK部分,如下所示:
CACHE MANIFEST
CACHE:
/css/style.css
/js/colors.js
/js/dropzone.js
/js/jquery.min.js
/js/script.js
/img/icon_analytics.png
/img/icon_exit.png
/img/icon_expand.png
/img/icon_list.png
/img/icon_lock.png
/img/icon_menu.png
/img/icon_more_content.png
/img/icon_settings.png
/img/icon_settings_black.png
/img/svg_icons/close_fullscreen.svg
/img/svg_icons/go_fullscreen.svg
/img/loader.gif
NETWORK:
*
点击此处阅读更多信息。
相关文章:
- 使用javascript在Flash中加载外部图像
- 如何在运行时在angular 2中加载外部js脚本
- Chrome扩展无法通过清单加载外部javascript
- 加载Angular视图后加载外部脚本
- Cordova/Phonegap在主要的Cordova网络视图中加载外部站点
- IE 9 BHO插件.加载外部JS文件时出现错误SCRIPT1014
- 是否有用于加载外部脚本的JavaScript库
- 使用纯Javascript加载外部URL内容
- 在Chrome扩展中加载外部javascript
- 在扩展 jQuery 之前加载外部资源
- 无法加载外部 JavaScript 文件 - Codeigniter
- jquery .load() 不加载外部 JS
- GO - html 文件无法加载外部 js 文件
- jQuery 不会使用 .load() 加载外部 html 模板
- 使用HTML5缓存时无法加载外部资源
- 色盒延迟打开;锁定“;当加载外部javascript文件时
- 使用load()加载外部文件,然后使用fancybox插件进行修改并显示
- 在Ember应用程序中加载外部域脚本
- html javascript加载外部脚本
- 如何防止加载外部资源,同时防止“在'文档'上执行'写入'失败”错误