If I have json data which looks like this:
{"d":1}
How do I check if that 1 is a 1 or a 0?
I have tried the following, but it goes straight to the else, even when I can see that the json data has a 1.
success: function(data) {
if (data[0]) {
console.log("Results...");
} else {
console.log("No results...");
}
the data contains {"d":1}
javascriptin the tags