Forum Moderators: open

Message Too Old, No Replies

HTTP "Service Streaming" - can it be done?

         

trevordixon

6:42 pm on May 8, 2008 (gmt 0)

10+ Year Member



So according to a page about "HTTP Streaming":

"The responseText property of XMLHttpRequest always contains the content that's been flushed out of the server, even when the connection's still open."

So I want to open an HTTP connection to a page that continually spits out data, and every few seconds I want to read the last line that was spit out. BUT, it apparently "only works on Firefox, whether XMLHTTPRequest or IFrame is used. In both cases, IE suppresses the response until its complete."

Is that accurate? Is there any way in javascript to read the server's response before the server finishes responding?

incrediBILL

11:19 pm on May 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If I'm not mistaken, all you have to do server-side is flush the web server cache as it's being sent and MSIE should pick up the results in increments.

[edited by: incrediBILL at 11:28 pm (utc) on May 10, 2008]

trevordixon

5:10 pm on May 13, 2008 (gmt 0)

10+ Year Member



In Internet Explorer, the responseText property of an XMLHttpRequest object is only available when readyState == 4. In Firefox 2, Opera 9, and Safari 3, (and maybe earlier versions of these browsers,) the responseText property can be read as the server flushes the data while readyState is still 3.