HTML and CSS Reference
In-Depth Information
A side effect of this is that the very first time the tasks.html page is loaded the browser will
access all resources twice. The first time will be to load all the resources for display to the
user; the second time will be to download them for the cache.
If this is a problem, it is possible to listen for application cache events in order to be notified
of cases where the browser discovers it needs to download a new version of the application:
window.applicationCache.addEventListener('downloading', function(e) {});
In order to add a listener that fires as each resource is downloaded you can add the follow-
window.applicationCache.addEventListener('progress', function(e) {});
Finally, to register an event listener to be notified when all resources have finished updating
add the following:
window.applicationCache.addEventListener(updateready, function(e) {});
In this function it would be possible to call the following if you want the client to have im-
mediate access to the revised application:
The Application Cache can be very annoying during the development phase, since re-
sources do not refresh on the client unless the manifest is changed, and even then, not until
the second time the page is requested. It is therefore recommended that you remove the
reference to the manifest in the html tag for the remainder of the exercises in this topic.
Search WWH ::

Custom Search