Pregunta

XDomainRequest not giving response while status is 200

var httpRequest = new XDomainRequest();
httpRequest.open('POST', url, true);
httpRequest.send(xmlDocument);
alert(httpRequest.responseText);
return httpRequest;

it is giving response text null. plz guide me where i am missing.

¿Fue útil?

Solución

try doing:

var httpRequest = new XDomainRequest();
httpRequest.onload=function() {
    alert(httpRequest.responseText);
}
httpRequest.open('POST', url, true);
httpRequest.send(xmlDocument);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top