javascript - EventListener UpdateReady not showing confirm on load when an update is actually there -


eventlistener updateready not showing confirm on load when update there. skips confirm alert , updates without notifications. doesn't reload.

window.addeventlistener('load', function(e) {     window.applicationcache.addeventlistener('updateready', function(e) {         if (window.applicationcache.status == window.applicationcache.updateready) {             confirm('an update available, install it?', function() {                 window.location.reload();             });         }     }, false); }, false); 

what have done wrong?

try doing this:

window.addeventlistener('load', function(e) { window.applicationcache.addeventlistener('updateready', function(e) {     if (window.applicationcache.status == window.applicationcache.updateready) {         if(confirm('an update available, install it?')) {                 window.location.reload();          }          }else {                 // no update happened            }     }, false); }, false); 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -