浏览器重新启动时 HTML5 离线功能不起作用
我正在使用离线 HTML5 功能来缓存我的 Web 应用程序。
有时它工作得很好,但在某些情况下它会表现得很奇怪。我试图找出原因以及如何解决它。
我正在使用 Sammy,我认为这可能是相关的。
当出现问题时,
如果在步骤 #1 中我浏览到 http://domain/App/ 包括斜杠。
还有一些其他奇怪的状态,它会进入未调用 sammy 路由的位置,因此页面保持空白,但我无法可靠地复制它。
??
更新:问题是上述步骤之前引起了问题。当我按照上述步骤操作时,它现在正在工作,所以很难说到底发生了什么。我每次都从一致的状态开始,因为我是从虚拟机中的快照开始。
我的缓存清单看起来像这样,
CACHE MANIFEST
javascripts/jquery-1.4.2.js
javascripts/sammy/sammy.js
javascripts/json_store.js
javascripts/sammy/plugins/sammy.template.js
stylesheets/jsonstore.css
templates/item.template
templates/item_detail.template
images/1Large.jpg
images/1Small.jpg
images/2Large.jpg
images/2Small.jpg
images/3Large.jpg
images/3Small.jpg
images/4Large.jpg
images/4Small.jpg
index.html
I am using the offline HTML5 functionality to cache my web application.
It works fine some of the time, but there are certain circumstances where it has weird behaviour. I am trying to figure out why, and how I can fix it.
I am using Sammy, and I think that might be related.
Here is when it goes wrong,
Everything works fine if in step #1 I browse to http://domain/App/ including the slash.
There are some other weird states it gets into where the sammy routes are not called, so the page remains blank, but I haven't been able to reliably replicate that.
??
UPDATE: The problem is that the above steps caused problems before. It is now working when I follow the above steps, so it is hard to say what is going on exactly. I am starting from a consistent state every time because I am starting from a snapshot in a VM.
My cache manifest looks like this,
CACHE MANIFEST
javascripts/jquery-1.4.2.js
javascripts/sammy/sammy.js
javascripts/json_store.js
javascripts/sammy/plugins/sammy.template.js
stylesheets/jsonstore.css
templates/item.template
templates/item_detail.template
images/1Large.jpg
images/1Small.jpg
images/2Large.jpg
images/2Small.jpg
images/3Large.jpg
images/3Small.jpg
images/4Large.jpg
images/4Small.jpg
index.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到了类似的问题。
我认为部分问题是 jquery ajax 误解了响应。我相信 sammy 正在使用 jquery 进行 ajax 调用,这会导致错误。
这是我用来测试这个的代码片段(尽管不是解决方案)
I'm running into a similar issue as well.
I think part of the problem is that jquery ajax is misinterpreting the response. I believe sammy is using the jquery to make the ajax calls, which is leading to the errors.
Here's a code snippet i used to test for this (though not a solution)