开发者

ipad html5 offline application showing internet connection error

I hav开发者_运维百科e created a ipad offline application. The safari shows internet connection not available message when i open the web page offline mode although I have set the cache manifest. I have listed all three files that is needed by the html page. the html page itself, css file and the logo image.

I have also set the manifest file name in html tag and htaccess file also.

Can I anybody let me know where I am doing wrong or Let me know the way to troubleshoot this.

the .html code

<!DOCTYPE HTML>
<html manifest="/main.manifest">
<head>


<meta name="viewport" content="width=device-width">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />

<title>Welcome</title>
<body>
thsi is test one
</body>
</html>

manifest

# test1
CACHE MANIFEST
/main.html

Thanks in advance !!!


My suggestion would be to follow the instructions in Dive into HTML5 exactly. HTML5 offline apps can be very "temperamental", so if something isn't exactly correct the whole thing stops working and it can be quite difficult to get useful error information.

It's very difficult to try and debug on an iOS device because the dev tools aren't really there. I've had success using Chrome to debug, the dev tools (particularly the storage and console sections) have quite a lot of useful information that you can use. If it doesn't work in Chrome you should be able to figure out more easily what's going on. If it does work in Chrome but not on an iOS device, then you will need to show us your files so we can help you more.


The first line of an application cache manifest must consist of the string "CACHE MANIFEST". Its pretty strict - so strict in fact that the first character of the file must be a "C". You on the other hand have a comment on the first line, which is why it doesn't work.

Specifically:

The first line of an application cache manifest must consist of the string "CACHE", a single U+0020 SPACE character, the string "MANIFEST", and either a U+0020 SPACE character, a U+0009 CHARACTER TABULATION (tab) character, a U+000A LINE FEED (LF) character, or a U+000D CARRIAGE RETURN (CR) character. The first line may optionally be preceded by a U+FEFF BYTE ORDER MARK (BOM) character. If any other text is found on the first line, it is ignored.

So the phrase "CACHE MANIFEST" has to be on the the "the first line" not "the first non-empty line" and not the "first non-comment line". It must be on the first line.

http://www.w3.org/TR/html5/offline.html#writing-cache-manifests


Does the code you posted work? If so, make sure for your actual application you haven't exceeded the cache manifest size limit for the iPad:

Max size iPad / iPhone Offline Application Cache

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜