HTML5离线缓存Manifest是什么

2019-01-28 21:52:44王旭
  •            // Manifest didn’t changed. Nothing new to server.   
  •          }   
  •        }, false);   
  •      }, false);   

    监听事件,对不同的状态做出相应处理:

    C/C++ Code复制内容到剪贴板
    1. var appCache = window.applicationCache;      
    2. // Fired after the first cache of the manifest.      
    3. appCache.addEventListener(‘cached’, handleCacheEvent, false);        
    4. // Checking for an update. Always the first event fired in the sequence.        
    5. appCache.addEventListener(‘checking’, handleCacheEvent, false);        
    6. // An update was found. The browser is fetching resources.        
    7. appCache.addEventListener(‘downloading’, handleCacheEvent, false);        
    8. // The manifest returns 404 or 410, the download failed,        
    9. // or the manifest changed while the download was in progress.        
    10. appCache.addEventListener(‘error’, handleCacheError, false);        
    11. // Fired after the first download of the manifest.        
    12. appCache.addEventListener(‘noupdate’, handleCacheEvent, false);        
    13. // Fired if the manifest file returns a 404 or 410.        
    14. // This results in the application cache being deleted.        
    15. appCache.addEventListener(‘obsolete’, handleCacheEvent, false);        
    16. // Fired for each resource listed in the manifest as it is being fetched.        
    17. appCache.addEventListener(‘progress’, handleCacheEvent, false);