Problem with linking when running offline with application cache (manifest)
Hi,
I'm developing a web app that will be placed and started from home screen on the iPhone and will need to work offline.
I've added a application cache solution using a cache manifest file which lists all the files I need to run the web app offline. I've stripped the solution down to just two files: index.html and page1.html
(and the js and css for jQuery to work).
When specifying the files in the manifest I got a problem since the jQuery Mobile adds a hash to the link as in:
index.html#page1.html
when the page page1.html is linked from index.html.
I can not specify the page:
index.html#page1.html
in the manifest file since # is used to add comments in the manifest file (maybe there's some way to escape it though...).
So, I tried to use the onClick and call a function that loads the page like this instead:
$.mobile.changePage("page1.html", "slide", false, false);
This works in Safari on iPhone running offline but only as long as we're in the same session as when online.
Restarting the Safari will end upp in the jQuery Mobile Ajax error "Error loading page" dialog.
So I changed my function once again to:
document.location.href = "page1.html";
And this actually works. Now both index.html and page1.html are available for offline browsing.
Even after Safari is restarted and even from a bookmark on the home screen.
But now I don't get the sweet jQuery Mobile transitions.
Does anyone know how I can solve this linking problem so I can use the transitions and keep it available offline?
Thanks!