Html5应用缓存

标签 html html5-appcache

我尝试使用 Html5 应用程序缓存在离线模式下运行我的应用程序。 为此,我创建了 test.html 文件和 demo.appcache

在这个 html 页面中,我使用了一些来自本地主机的图像。当我的本地主机运行时,它工作正常。但是,如果我试图停止本地主机,图像不会从我的应用程序缓存中获取。 out put 只是显示为空页面。

这是我的 sampletest.html

<!DOCTYPE html>

<html manifest="demo.appcache">

<head>
</head>

<body>
Further modified........Test Again
<img src="http://172.17.0.238/SampleImages/two.jpg" width="225" height="151" alt="Milford Sound in New Zealand" />

</body></html>

演示.appcache

CACHE MANIFEST
CACHE:
sampletest.html
NETWORK:

回退:

我的代码有什么问题吗?在 CACHE 下:我加载了我的 html 文件。但是,当本地主机不可用时,它不会从应用程序缓存中加载 html。

任何帮助... 问候, 洛克什。

最佳答案

您必须在 list 中包含页面所需的所有资源:图像、外部 javascript 和 css 等。

关于Html5应用缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10298514/

相关文章:

电子邮件正文中的 Javascript 执行

javascript - jQuery - 在 if 语句参数中使用 css

javascript - 由于某种原因,表格到 Excel 导出为文本?

HTML 5 缓存 : window. applicationCache.abort();不起作用

javascript - 应用程序缓存 list 未在 Firefox 中加载,在 Chrome 和 Safari 中正常

javascript - 如何为 TD 设置省略号

javascript - 带有土耳其语文本的 HTML 未显示在 UIWebview 中

iis-7 - 带有IIS7的AppCache MIME类型

javascript - 应用程序缓存错误 : Invalid or missing manifest origin trial token

google-chrome - 缓存跨域 Assets 时,Chrome 应用程序缓存不发送 `Origin` header