-
xmlhttp.Send problem
Help!
when doing the following- xmlhttp.Send(xmlSend);
on this object- var xmlhttp = new ActiveXObject("MsXml2.XmlHttp")
I sometimes get an error (after an IIS reset) that-
“The download of the specified resource has failed”
but sometimes it works.
I've read that it may be due to the version of MSXML that I'm using, but I've tried different versions- (MSXML2.XMLHTTP.6.0) and it doesnt seem to make a difference.
Any idea why this is happening?
(The xml I'm sending is always the same and is ok)
thanks
-
Re: xmlhttp.Send problem
This is an AJAX problem, I will have it moved there. I would suggest using the following code to call your AJAX XML initialization.
Code:
var xmlHttp;
try{xmlHttp = new XMLHttpRequest();}
catch(e){
try{xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){
try{xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){
alert("Your browser does not support AJAX!");
return false;
}
}
}
-
Re: xmlhttp.Send problem
PeejAvery, thank you for the reply,
but it didn't help solve my problem.
I do not fail on the object creation, but on the send function.
the browser supports ajax because it works some of the time, and even if it didnt, catching the exception wouldnt help me solve the problem.
thanks
-
Re: xmlhttp.Send problem
Can you please post the whole sending function? Are there any abnormalities that happen when it fails besides the IIS reset? Is the reset a server problem or user initiated?
-
Re: xmlhttp.Send problem
The problem happens after I initiate an IIS reset. There are no other abnormalities.
a very important thing I neglected to mention- the page I give as url to send to is an aspx with .net code in its CS.
function xmlSyncHttpReq(sURL, xmlSend, bThrowExc){
try{
var xmlhttp = new ActiveXObject("MsXml2.XmlHttp.6.0");
xmlhttp.Open("POST", sURL, false);
problem is here- xmlhttp.Send(xmlSend);
if(xmlhttp.responseXML.documentElement){
if (checkHTTPErrors(xmlhttp.responseXML)) return false;
else return xmlhttp.responseXML.documentElement;
}
xmlhttp = null;
return true;
}catch(e){
if (bThrowExc)throw e;
else alert(e.description);
}
}
thanks again