Is it possible to handle a JSON response using plain Ajax (i.e. JavaScript, without JQuery)?
In this description: http://www.w3schools.com/ajax/ajax_xmlhttprequest_response.asp only Text and XML objects are mentioned, but how to handle a JSON respone?
I just want to use pure JavaScript, without any additional libraries.
This shows me the JSON respone:
console.log(xhttp.responseText);
You can use JSON.parse():
console.log(JSON.parse(xhttp.responseText));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With