【发布时间】:2011-10-30 01:12:08
【问题描述】:
我正在尝试为装有 iOS 4.3.4 的 iPad 2 构建一个 HTML5 驱动的离线应用程序。我按照在几个网站上看到的说明进行操作,甚至能够使用 Chrome 的开发者工具验证缓存是否正常工作:
Creating Application Cache with manifest http://localhost/experiments/test.manifest
Application Cache Checking event
Application Cache Downloading event
Application Cache Progress event (0 of 2) http://localhost/experiments/offlineApp.js
Application Cache Progress event (1 of 2) http://localhost/experiments/offlineApp.css
Application Cache Progress event (2 of 2)
Application Cache Cached event
我有一个主屏幕图标以及一个“启动屏幕”图像。我可以很好地将应用程序下载到主屏幕,并且在那里看到图标。但是,当我关闭 Wi-Fi 并尝试打开应用程序时,我收到可怕的“无法打开,因为它没有连接到 Internet”警报。
有谁知道 iOS 4.3.4(或更早版本的操作系统)是否发生了改变,从而改变了实现 HTML5 的这一功能的要求?
谢谢!
编辑
我在“localhost”设置之外再次尝试了这个。这是我的 HTML:
<!DOCTYPE html>
<html lang="en" manifest="/experiments/cache.manifest">
<head>
<meta charset="utf-8"/>
<title>cache.manifest test</title>
<link rel="stylesheet" href="cache-manifest-test.css"/>
<link rel="apple-touch-icon" href="icon.png"/>
</head>
<body>
<h1>cache.manifest</h1>
<p>Let's see if this thing works...</p>
<script src="cache-manifest-test.js"></script>
</body>
</html>
这是我的 cache.manifest 文件的内容:
CACHE MANIFEST
cache-manifest-test.css
cache-manifest-test.js
我在 Chrome 的开发者工具中看到了正确的结果。我收到“应用程序缓存缓存事件”。它只是无法离线工作。我真的被难住了……
有谁知道我可以将完整代码复制到我的服务器并尝试的任何页面?
谢谢...
【问题讨论】:
-
如果对您之前的问题有帮助,您应该接受一些答案。如果您不知道如何操作,可以查看the FAQ。
-
@WTP - 它让我忘记了。谢谢提醒。
-
@jtbandes - 我看了你提到的那个问题,那里提供的解决方案都没有帮助我的情况...... :-(
标签: ios html ios4 ipad-2 manifest.cache