开发者

How can I check if a page is available offline in HTML5?

I want to create a magazine reader in HTML5. One feature I'd like to add is ability to read articles while being offline.

I'd like to show a li开发者_如何学Pythonst of previously accessed articles and still available offline. The problem is that I don't know if it's possible to check if a given URL is available in a user's offline cache or not. I could store previously accessed URLs in local storage but I can't be sure if these URLs are still available in the cache. Is it possible to be notified when a given URL is removed from the cache or check if the URL is available offline?

Thanks, Michal


There's no way in the HTML5 spec. Firefox has an experimental mozItems property of window.applicationCache, but it seems to not work: always has a length of 0. I don't know if webkit has anything similar.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜