开发者

The iPad applicationCache events can't update the screen

开发者 https://www.devze.com 2023-01-20 09:13 出处:网络
I have an html5 application that listens to all window.applicationCache events. When it needs to download, I write a pretty dialog to the screen, and during the progress event I calculate the percenta

I have an html5 application that listens to all window.applicationCache events. When it needs to download, I write a pretty dialog to the screen, and during the progress event I calculate the percentage of files done by doing the right math on the event.loaded and event.total properties, in order to update the percentage with it.

The result is a fine dialog that says "Installing n%" up to 100. Everything works out as I expect it, and the application caches offline nicely and starts on all browsers.

However, on iPad, this doesn't seem to work. The only thing I can achieve during applicationCache events is write to the console. There I do see these events actually being listened to by my handlers.

I've tried everyting up to function timeouts.

My questions:

  1. Is there a way to update any HTML and visualize this during these events on iPad?
  2. Why is the iPad not downloading everything in one go like all other browsers开发者_如何学JAVA do? It seems to go into idle state for a reason unknown to me.

PS: I need to cache over 600 files. The total size is under 1Mb in total.


I have the same problem. The other applicationCache events (updateready, cached, downloading) do trigger and you can change the html using jQuery or whatever to indicate changes but not the progress event. I can understand that the iPad might not choose to support this event as this is an event that could get triggered many times and may affect the perfomance of the iPad's slower processor. Regarding the download, you need to make sure that every resource listed in your manifest is available.

0

精彩评论

暂无评论...
验证码 换一张
取 消