I have a Piece of code in JS to loop a JSON using Jquery each function. it's showing error as length is null or not an object.
var claimJSONString = '{"claimJSON": [' + jsonString + ']}';
//alert(claimJSONString);
J.each(claimJSONString.claimJSON, function (i, v) {
alert("v::" + v.tranID);
});
claimJSONString alerts as :
{
"claimJSON": [
{
"tranID": "12581",
"a": "0",
"b": "0",
"c": "0",
"d": "0"
}
]
}
Also tried
J.each(jsonString, function (i, v) {
alert("v::" + v.tranID);
});
where jsonString is { "tranID": "12581", "a": "0", "b": "0", "c": "0", "d": "0" } now the error is Object Expected.
What am I doing wrong?
P.S. I am close to tearing my hair out. Please Help! P.S.S Jquery Newbie