Here's my JS code from a success section of an AJAX call:
success: function(msg){
var data = JSON.parse(JSON.stringify(msg));
$("#searchResults").html(data + " Value for 'a': " + data.color + "\nValue for 'b': " + data.message);
}
Here's what's printed on the page:
{"color":"Yellow","message":"Pending"} Value for 'a': undefined Value for 'b': undefined
Why are they undefined?