If your response is valid JSON, try the following:
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
var jsonResponse = JSON.parse(xmlhttp.responseText);
console.log(jsonResponse);
}
}
You can try responseType
xmlhttp.responseType = 'json'
But first check browser support.
I'm trying to find a simple, elegant way to create a "delete" button for a user's comments on a site I'm working on. Ideally, I'd like to register an event handler for a class called something like "...
I'm trying to find a simple, elegant way to create a "delete" button for a user's comments on a site I'm working on. Ideally, I'd like to register an event handler for a class called something like "...
I have created two functions that run a similar set of IF statements, one shows the cost of a game, the other its name. I have used "onclick" to display both values in my form. It all works but ...
I have created two functions that run a similar set of IF statements, one shows the cost of a game, the other its name. I have used "onclick" to display both values in my form. It all works but ...
I'm new to Mocha and I'm trying to run the tests on this code: "use strict"; process.env.NODE_ENV = 'test'; var assert = require('assert'), Browser = require('zombie'), xapp = require('../...
I'm new to Mocha and I'm trying to run the tests on this code: "use strict"; process.env.NODE_ENV = 'test'; var assert = require('assert'), Browser = require('zombie'), xapp = require('../...
I've been trying to push a complex json data record into a json variable. This is the code I tried to do so. var marks=[]; var studentData="student1":[{ "term1":[ {"LifeSkills":[{...
I've been trying to push a complex json data record into a json variable. This is the code I tried to do so. var marks=[]; var studentData="student1":[{ "term1":[ {"LifeSkills":[{...