'msxml3.dll: The download of the specified resource has failed -When using XMLHTTP
I have a java script code snippet where i am making an XMLHTTP request to a remote server page. The below is my code
var objXMLdom = new ActiveXObject("Microsoft.XmlDOM")
var objXMLRecdom = new ActiveXObject("Microsoft.XmlDOM")
objXMLdom.async = false
var objXMLRoot = objXMLdom.createElement("root");
objXMLdom.documentElement = objXMLRoot;
objXMLRoot.setAttribute("strWoCode",id);
var objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
strHTTP = "getDataResponse.aspx?wocode="+strWoCode+"&mode="report";
objXMLHttp.open("POST",strHTTP,false)
objXMLHttp.send(objXMLdom);
When the last line (send()) is executing,I am getting an error like " msxml3.dll: The download of the specified resource has failed." . My development machine is running on Win XP SP 2
Can anyone help to get rid of this ?
Solution 1:[1]
The problem is caused by your strHTTP variable. It needs to contain the full URL. Also, don't forget to encode your strWoCode variable to prevent URL injection.
strHttp = "http://www.mywebsite.com/getDataResponse.aspx?";
strHTTP = strHTTP + "wocode="+encodeURIComponent(strWoCode)+"&mode="report";
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | jveazey |
