Problem with XmlHttpRequest Javascript

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • (Edited)
this script logs 'null' for the xml object, I know I should use jQuery, but I would like to use an XHR object on this occasion, since I am working with another company's API as well and it would be really nice to know how to use XHR with quickbase

function procVehicleXml(){
var xml;
var request = new XMLHttpRequest();
request.open("POST", rprUrl, true);
request.onreadystatechange = function(){
if (this.readyState === 4 && this.status === 200){
xml = this.responseXML;
console.dirxml(xml);
}
};
var apiMethod = {
apptoken: token,
action: "API_DoQuery",
clist: "35"
};
request.send(JSON.stringify(apiMethod));
}
Photo of John Barulich

John Barulich

  • 634 Points 500 badge 2x thumb

Posted 4 months ago

  • 0
  • 1

Be the first to post a reply!