W3C home > Mailing lists > Public > public-webapi@w3.org > April 2006

Re: XMLHttpRequest progress events

From: Jim Ley <jim@jibbering.com>
Date: Tue, 25 Apr 2006 11:05:35 +0100
Message-ID: <006301c6684f$cc3358a0$2402a8c0@Snufkin>
To: "Web APIs WG" <public-webapi@w3.org>

"Jonas Sicking" <jonas@sicking.cc>
> The problem lies in if the XHR implementation doesn't know the total size. 
> Then it can't give you a percentage.

Something needs to be defined to be done in this situation, not knowing the 
size is likely the standard in many uses of XHR.

> If it gives you the number of bytes transferred do far, the user or the 
> script can figure out the progress even if the XHR implementation doesn't 
> know the total size.

Exactly, if we look at existing implementations, the IE onProgress event 
(not available in a default security environment) provides currentBytes and 
totalBytes (or 0) which I've used for preloading resources.


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/html/07b3e629-a558-4a0e-8307-ca922f56e00c.asp

Macromedia Flash does the same

http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002219.html

If there was always a content-length, then there'd be no problem with just 
having a percentage, however there's not. It's another problem with trying 
to re-use properties from a defunct specification that considered such a 
tight range of use cases as the DOM3 L&S - it was about parsing XML 
documents, not downloading web content.

Jim.
Received on Tuesday, 25 April 2006 10:06:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:55 GMT