Hi Lee - but that's just it, the links should still be valid because
they are pages in the cache, listed in the manifest. I can see them in
there when debugging in firefox using about:cache.

Stepping through the iUI script, I think I can see where things break
down in the click event that should load the subpage.
A new XMLHttpRequest is created and opened with GET to "http://
teledemic.com/btown/index.php?date=2010-1-24"
When online and readyState == 4 is reached, responseText contains the
text of index.php?date=2010-1-24 as expected.
When offline and readyState == 4 is reached, responseText is empty
(""). I assumed that since index.php?date=2010-1-24 is in the cache,
it should be accessible to XMLHttpRequest. Is this wrong?

Using local storage in javascript, if that's what you mean, is an
interesting idea. I'd rather not rewrite the whole thing since as far
as I know it should work well as is, so I'll keep trying.

On Jan 22, 11:27 am, QuickConnect <[email protected]> wrote:
> Have you looked at using the built in SQLite db instead of the
> manifests?
>
> As per your links problem, when you are offline your the links are
> invalid.  You could combine your currently seperate pages into one and
> then use DHTML concepts and CSS to hide and display the them in
> response to user selection of your links.
>
> You can then use CSS transitions between the different displays.  A
> nice side effect is that this approach makes your app look very
> integrated to the user.
>
> Any data you need could be stored in the SQLite database.  If you need
> to update local or remote data you can use AJAX to get it from or send
> it to the server.
>
> Lee
>
> On Jan 22, 7:30 am, teledemic <[email protected]> wrote:
>
> > Yup, that is quite annoying but not the problem here. In fact I'm
> > hoping to get around that problem by having the main page always be
> > static, and generate the links to subpages itself with javascript. So
> > you go to the site, and get the main page with all the links.
> > Meanwhile, the new manifest is noticed and the old cache invalidated.
> > When you go to a subpage, everything is fresh by then, no reloads
> > required.
> > Anyway, the problem here is that in this case, when taken offline, the
> > links don't go anywhere.
>
> > On Jan 21, 3:27 pm, Andrew Hedges <[email protected]> wrote:
>
> > > Something to remember about cache manifests is that the new resources
> > > will be available not when the user loads the app with the new
> > > manifest, but the following time the app is launched. It's akin to
> > > opening desktop software and being prompted to install updates. Those
> > > updates are in place only after you relaunch. Here's a great
> > > explanation of this and pretty much everything else you need to know
> > > about cache 
> > > manifests:http://building-iphone-apps.labs.oreilly.com/ch06.html
>
> > > On Jan 21, 5:05 am, teledemic <[email protected]> wrote:
>
> > > > Thanks Greg - good point! Here is the manifest:
> > > > -----
> > > > CACHE MANIFEST
>
> > > > iui/cancel.png
> > > > iui/backButton.png
> > > > iui/selection.png
> > > > iui/pinstripes.png
> > > > iui/iuix.js
> > > > iui/listArrow.png
> > > > iui/toggleOn.png
> > > > iui/listArrowSel.png
> > > > iui/toolButton.png
> > > > iui/toolbar.png
> > > > iui/iuix.css
> > > > iui/blueButton.png
>
> > > > index.php?date=2010-01-20
> > > > index.php?date=2010-01-21
> > > > index.php?date=2010-01-22
> > > > index.php?date=2010-01-23
> > > > index.php?date=2010-01-24
> > > > index.php?date=2010-01-25
> > > > index.php?date=2010-01-26
> > > > -----
>
> > > > The last 7 lines are auto-generated each night. These are the subpages
> > > > linked to by the list items on the main page. So the expected behavior
> > > > is that, on a given day, all the info for the current week is
> > > > downloaded and cached. For the rest of the day, the manifest stays the
> > > > same and the iPhone keeps using the cached pages. The next day, when
> > > > visited, the manifest change is noticed and the cache is refreshed
>
> > > > On Jan 19, 10:43 am, gsb <[email protected]> wrote:
>
> > > > > One thing is the DocType:
> > > > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
> > > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> > > > > <html xmlns="http://www.w3.org/1999/xhtml"; manifest="btown.manifest">
>
> > > > > Instead, you should use the HTML5 DocType:
> > > > > <!DOCTYPE html>
> > > > > <html lang="en" manifest="btown.manifest" >
> > > > > <head>
>
> > > > > Next, I suggest that you include a copy of your manifest to insure
> > > > > that you make correct use of the options.
>
> > > > > Greg

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to