gpt4 book ai didi

javascript - 无法在 'update' : there is no application cache to update 上执行 'ApplicationCache'

转载 作者:行者123 更新时间:2023-12-04 06:44:04 25 4
gpt4 key购买 nike

ApplicationCache 不会缓存任何东西
index.html

<!DOCTYPE html>
<html manifest="cache.appcache">
<head>
<title>Zipcode Database</title>

文件cache.appcache

CACHE MANIFEST
my.js

htacces 文件

AddType text/cache-manifest .appcache

在控制台中运行

applicationCache.update(); 

然后错误: InvalidStateError:无法在“ApplicationCache”上执行“更新”:没有要更新的应用程序缓存。代码:11消息:“无法在‘ApplicationCache’上执行‘更新’:没有要更新的应用程序缓存。”名称:“无效状态错误”堆栈:“错误:无法在“ApplicationCache”上执行“更新”:没有要更新的应用程序缓存。↵

applicationCache.cache =0

最佳答案

list 非常好,不同的部分完全是可选的。

如果状态为 0,这仅意味着浏览器从未成功下载 list 及其所有内容。所以如果你想手动运行 applicationCache.update() 方法,确保有一个缓存并且它当前没有被更新,例如

状态 == 1 ||状态 > 3

参见 http://www.html5rocks.com/en/tutorials/appcache/beginner/了解更多信息。

关于javascript - 无法在 'update' : there is no application cache to update 上执行 'ApplicationCache',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24427595/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com