最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - External resources fail to load when using HTML5 cache - Stack Overflow

programmeradmin3浏览0评论

I'm trying to get app cache to work:

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

But here is what I'm getting in the console:

GET  net::ERR_FAILED
(index):517 Uncaught ReferenceError: google is not defined
(index):524 GET .js net::ERR_FAILED
0.s3.envato/files/115114837/profile.jpg:1 GET .jpg net::ERR_FAILED
jquery.min.js:3 GET .woff2 net::ERR_FAILED

Apparently, it refuses to load any resources which are not specified in the .appcache file. I even tried to specify only the images, it still throws errors for the stylesheet and all .js files.

What's going on?

I'm trying to get app cache to work:

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

But here is what I'm getting in the console:

GET https://www.google./jsapi net::ERR_FAILED
(index):517 Uncaught ReferenceError: google is not defined
(index):524 GET http://www.google-analytics./analytics.js net::ERR_FAILED
0.s3.envato./files/115114837/profile.jpg:1 GET https://0.s3.envato./files/115114837/profile.jpg net::ERR_FAILED
jquery.min.js:3 GET http://fonts.gstatic./s/roboto/v15/mnpfi9pxYH-Go5UiibESIpBw1xU1rKptJj_0jans920.woff2 net::ERR_FAILED

Apparently, it refuses to load any resources which are not specified in the .appcache file. I even tried to specify only the images, it still throws errors for the stylesheet and all .js files.

What's going on?

Share Improve this question asked Mar 7, 2015 at 18:41 Nikolay DyankovNikolay Dyankov 7,27811 gold badges65 silver badges89 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

You need to add the NETWORK section, like this:

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:
*

Read more here.

发布评论

评论列表(0)

  1. 暂无评论