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
Post a Comment