Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 6. Going Offline > What You’ve Learned - Pg. 113

As you can see, I currently have only one row in the FallbackURLs table. If cache id 14 is requested by the browser, and any URLs that begin with http://jonathanstark.com/ labs/app-cache-3/images/ fail for whatever reason (the user is offline, images are miss- ing, etc.), the fallbackURL will be used instead. I apologize if this section is a bit complex, but at this point it's all we've got. Maybe browser vendors will implement some sort of user interface that will allow us to browse the application cache--similar to those for the local storage and client-side database-- but until that time comes, this is our only option for prowling around in the depths of client-side storage. What You've Learned In this chapter, you've learned how to give users access to a web app, even when they have no connection to the Internet. This offline mode applies whether the app is loaded in Mobile Safari, or launched in full screen mode from a Web Clip icon on the desktop. With this new addition to your programming toolbox, you now have the ability to create a full-screen, offline app that is virtually indistinguishable from a native appli- cation downloaded from the App Store. Of course, a pure web app such as this is still limited by the security constraints that exist for all web apps. For example, a web app can't access the Address Book, the camera, the accelerometer, or vibration on the iPhone. In the next chapter, I'll address these issues and more with the assistance of an open source project called PhoneGap.