I just was looking around too, and found roughly the same thing. However, it should be done with readyState 3, not with 4.... (as 4 is triggered when done)?
http://www.sitepoint.com/blogs/2004/05/26/xmlhttp...vascript-closures/
code:
86 // Called multiple while downloading in progress
87 case 3:
88 // Notify user handler of download progress
89 try {
90 // Get the total content length
91 // -useful to work out how much has been downloaded
92 try {
93 var contentLength = client.xmlhttp.getResponseHeader("Content-Length");
95 } catch ( e) {
96 var contentLength = NaN;
97 }
98
99 // Call the progress handler with what we've got
100 client.userhandler.onProgress(
101 client.xmlhttp.responseText,
102 contentLength
103 );
104
105 } catch ( e) { /* Handler method not defined */ }
106 break;
...
131 onProgress: function(responseText, length) {
132 echo("Downloaded "+responseText.length+" of "+length+"<br>");
133 },