HTML and CSS Reference
In-Depth Information
ing the new version of the cache. If the user confirms, the event handler will call win-
dow.location.reload to reload the application using the new cache version.
Add the code from the following listing to app.js, just after the dropDatabase function
you created in listing 5.16 .
Listing 5.18. app.js—Automatic update detection and loading
Try it out
That's all there is to it! If you've followed these steps correctly, you should now be able
to use your application offline. If you put this application on a server with a registered do-
main name, you could test this application on your mobile device's browser. Just visit the
site in order to load the application for the first time. Now, turn on Airplane Mode on your
device, which should kill all network connectivity. Refresh the page in your device's web
browser, and you should still be able to use the application in full. The result can be seen in
the screenshots in figure 5.7 .
Search WWH ::

Custom Search