Invokes the application cache download process. Throws an InvalidStateError exception if there is no application cache to update. Calling this method is not usually necessary, as user agents will generally take care of updating application caches automatically. The method can be useful in situations such as long-lived applications. For example, a Web mail application might stay open in a browser tab for weeks at a time. Such an application could want to test for updates each day.
Method of apis/appcache/ApplicationCacheapis/appcache/ApplicationCache
Syntaxvar result = window.applicationCache.update();
Return Value
Returns an object of type nullnull
Type: HRESULT
This method can return one of these values.
S_OK DOMException.INVALID_STATE_ERR11
This exception is thrown if the application cache cannot be found or the status of the cache is obsolete. Examplesvar applicationCache = window.applicationCache;
applicationCache.update();
if (applicationCache.status == window.applicationCache.UPDATEREADY) {
applicationCache.swapCache();
if (confirm('A new version of this site is available. Do you want to load it?')) {
window.location.reload();
}
}
Notes
Use this method and check the status before using swapCache.
The update method returns before the update check is complete, so it is a best practice to wait before checking the status property or calling the swapCache method.
The update method is provided for convenience, but is not necessary for basic functionality. Loading or refreshing the page is sufficient.
Related specificationsMicrosoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4