Wednesday, 16 September 2009
Cool ... iPhone handles the HTML5 onstorage event handler
… or in other words we can readily synchronise local browser storage with back-send server persistent storage. This is one of the fundamentals of compelling off line web applications.
But this ain’t much good if you can’t get this data back to the server to do something useful with it, e.g. share with friends, share with your other devices, keep a backup, send a message … I could go on.
Instead we can know use the onstorage attribute on the HTML body tag to hook into a function that will handle all of these call backs based on local stored data.
Take a look at it in action in the bemoko mobile test suite. It works on iPhone 3 and Safari 4. You can even see the complete code here.