My server side code returns a value which is a json object on success and a string \'false\' on failure. Now how can I check whether the returned value is a json object?
var data = 'json string ?'; var jdata = null; try { jdata = $.parseJSON(data); }catch(e) {} if(jdata) { //use jdata }else { //use data }