I have simple XMLHttpRequest.
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
}
};
xhr.send();
As you can see that I’m printing this.responseText in the console which outputs something like following
({ "status": "success", "data": { "title": "Post1" })
How can I get the JSON inside. I am totally aware of JSONP concepts but I don’t want $.ajax in jQuery, I’m trying to achieve this via javascript. Thanks