سؤال

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.

هل كانت مفيدة؟

المحلول

try doing:

var httpRequest = new XDomainRequest();
httpRequest.onload=function() {
    alert(httpRequest.responseText);
}
httpRequest.open('POST', url, true);
httpRequest.send(xmlDocument);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top