I have a Cross Platform request call, and it gets the data inside the xhr.onload function, how do I return that data to the main function?
makeCorsRequest(email) {
var xhr = this.createCORSRequest(email);
xhr.send()
xhr.onload = function() {
var text = xhr.responseText;
return text //I want to return this on the makeCorsRequest function after the .send() is done
};
}