首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS离线网络应用-进度条?

iOS离线网络应用-进度条?
EN

Stack Overflow用户
提问于 2013-08-21 20:44:16
回答 1查看 335关注 0票数 0

我正在制作一个离线的网络应用程序,看起来大概是1.5MB。

是否检查清单中的所有脱机文件都是在用户标记我的应用程序时下载的?或者更好的是,像它这样的进度条是iTunes应用程序下载。

1.5MB可能是安全的,但假设我制作了一个50 3G的离线web应用程序,用户在没有3G服务的iPad上在Wi上标记了这个web应用程序。他们将其书签,然后立即离开Wi区域,他们(或我知道),如果所有的文件是本地缓存/存储?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-08-24 22:55:54

使用appCache事件侦听器

代码语言:javascript
复制
function handleCacheEvent(e) {
  // Do your thing
}

function handleCacheError(e) {
  alert('Error: Cache failed to update!');
};

// Fired after the first cache of the manifest.
appCache.addEventListener('cached', handleCacheEvent, false);

// Checking for an update. Always the first event fired in the sequence.
appCache.addEventListener('checking', handleCacheEvent, false);

// An update was found. The browser is fetching resources.
appCache.addEventListener('downloading', handleCacheEvent, false);

// The manifest returns 404 or 410, the download failed,
// or the manifest changed while the download was in progress.
appCache.addEventListener('error', handleCacheError, false);

// Fired after the first download of the manifest.
appCache.addEventListener('noupdate', handleCacheEvent, false);

// Fired if the manifest file returns a 404 or 410.
// This results in the application cache being deleted.
appCache.addEventListener('obsolete', handleCacheEvent, false);

// Fired for each resource listed in the manifest as it is being fetched.
appCache.addEventListener('progress', handleCacheEvent, false);

// Fired when the manifest resources have been newly redownloaded.
appCache.addEventListener('updateready', handleCacheEvent, false);
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18367328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档