i've never seen implementing localStorage like this.
i try and do it the way it's introduced here:
http: // www. webreference.com/authoring/languages/html/HTML5-Client-Side/
BUT, the same problem for me, because whenever i restart my iPhone, the localStorage is cleared...
maybe the client-side database, which also is described on the above link, will help us there :)
edit: (some minutes later)
just restarted my iPhone and tested my application again - otherwise it won't let me fall asleep tonight:) - it works
this is a quite good article about local storage and at the end a very very VERY nice example, that works too.
Problem maybe: language of article is german, but example tells it own tale ;)
article:
http://blog.robocode.ch/685/html-5-local-data-storage-eine-kurze-einfuhrung/
example from article:
http: // www. robocode.ch/lab/localstorage/
explanation for non-german speakers:
"Bleibt für ewig" - entries will be there forever
"Bleibt bis das Browserfenster verlassen oder der Browser geschlossen wird. (Je nach Browser)" - entries will be deleted as soon as session is over, browser closed, browser window closed (depending on browser)