I have a JSON string like this:
{"{\"nodeName\":\"abc\"}":[{"url":"abc","status":true},{"url":"abc","status":true}]," {\"nodeName\":\"pqr\"}":[{"url":"abc","status":true},{"url":"abc","status":true}]}
i am able to get the value(v) using below query code but not able to get key(k). On alert i am getting (undefined abc true). value of k is undefined.
$.each(obj, function() {
$.each(this, function(k, v) {
alert(k.nodeName +" "+ v.url +" "+v.status);
});
});
I need value of (k) for further validation. I've validated the JSON string to make sure it was valid, so what am I missing here or is there any other way of doing this?? Please help...
Also, From server end i am passing json object like this:
json.put(js.toString(),jsarray)
where
json = json OBject,
js = json Object,
jsarray = json Array.