I want to check an element is exist in the json data for that am doing
$.get('/geteststatus', getdata, function (data) {
if (data != "" || data[0].status ) {
});
where getdata
is unique id
am getting this error
TypeError: data[0] is undefined
if (data != "" || data[0].status) {}
json data contains only one row value.it does not contain multiple values.so i used data[0]
checking
json data
{"id" : "12" , "status" : "GC", "_id" : ObjectId("52f3045873e7e96b18000005") }