开发者

Why does my web-app work offline in Firefox, but not on iPad?

开发者 https://www.devze.com 2023-03-27 05:25 出处:网络
I recently wrote a few scripts for Javascript which I am trying to run as a native app on my iPad in offline mode.

I recently wrote a few scripts for Javascript which I am trying to run as a native app on my iPad in offline mode.

The scripts do nothing complex, simply run off a bunch of prompts and generate a document.write() based on the information the user has entered.

So I set up my own little website to host the scripts on and went about setting up an application cache. I am new to this sort of thing however from what I gather, I have followed instructions correctly. To set up my app cache, I did the following:

Added the following two lines to my .htaccess file: AddType text/cache-manifest .manifest AddType text/manifest .manifest

Made a new file called "generator.manifest", which has the following lines: CACHE MANIFEST generator.html answergenerator.js

And added in to my generator.html file:

Apart from a few functions used to prompt some iOS 开发者_开发问答features, all I have in my generator.html file is this:

along with the other stock standard html tags.

That is my appcache setup. The generator.manifest file is in the exact same directory as the generator.html file.

When I enter Firefox and go to my site, I can run the script, allow it to cache files for offline usage (Firefox comes up with a prompt), and then run the script in offline mode.

HOWEVER, whenever I try to do this on my iPad (4.2.1), I simply get the error: "Generator could not be opened because it is not connected to the Internet."

Where have I gone wrong? Can someone help me fix this please?

A huge thanks in advance, Haz.


You might look at this answer. iOS does seem to have some issues. I found that I had to power cycle my iPad (in addition to clearing open Safari's) before it would recognize the appcache.

0

精彩评论

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