|
|
|
date: Mon, 3 Apr 2006 00:34:02 -0700,
group: microsoft.public.inetsdk.programming.scripting.jscript
back
RE: How to read the streaming data from IE xmlhttprequest object
The state you may want to check is four not three, I guess. The following
code works just fine for me.
function HandleHttpResponse () {
if ( http.readyState == 4 ) {
if ( http.status == 200 ) {
loadXML();
var oNode = xmlDoc.selectSingleNode ( "/foo/bar" );
if ( null != oNode ) {
var s = oNode.text;
document.getElementById ( "baz" ).value = s;
}
}
}
}
function loadXML() {
if (window.ActiveXObject) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(http.responseText);
}
else if (document.implementation &&
document.implementation.createDocument) {
xmlDoc= document.implementation.createDocument("","",null);
xmlDoc.load(http.responseXML.xml);
alert ( http.responseXML.xml );
}
else {
alert ('Your browser cannot handle this script');
}
}
"Vijay" wrote:
> Hi Folks,
> I having one issue, in my application I am going to use the server push
> for streaming the data by keeping the connection open. At client side,
> i am having the XMhttprequest object (i.e ActiveX object of IE). When
> the data comes, onreadystatechange method get callback on state 3 but
> it doesn't allow me to read the data from the object. It says 'The data
> necessary to complete this operation is not yet available'. Is it
> possible to read the streaming data from the XMLHttprequest object in
> IE?
>
> I know Mozilla supports to read the data, when the ready state is 3. In
> Internet Explorer, how we can use the XMLhttp Active object to read the
> streaming data.
>
>
> Plz help, if any body knows any possible way of implementing.
>
>
>
date: Tue, 11 Apr 2006 12:56:02 -0700
author: Keith. O
|
|