I have some json that looks like this....
{"errorMessage":"Items not found, please enter additional search criteria"}
This only gets returned when there is a server error. On other times where there are no server errors a json object with a json arrary in it is returned.
Inside my getJson method I want to write some jquery to check if the json returned contains a key "errorMessage" and if it does I want to get it's value. But I'm struggling to find the right way.
$.getJSON( sSource, aoData, function (json) {
// need to do check here
fnCallback(json);
} );
Can someone give me a hand please? thanks