I need to get values from a JSONString using javaScript. I did the following :
jsonData = JSON.stringify(data);
var jsonVar = "jVar";
for (var l = 0; l < jsonData.jsonVar.length; l++) {
var item = jsonData.itemI+"-"+itemJ+"-"+itemK.split(' ').join('')[i];
alert(cuecard);
}
Here is the JSONData:
{"jVar":["123","234"]}
But i am getting the following exception:
Uncaught TypeError: Cannot read property 'length' of undefined
at Object.success (test.jsp:62)
at i (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at A (jquery.min.js:4)
at XMLHttpRequest.<anonymous> (jquery.min.js:4)
I saw the example in here and i dont know the mistake i am doing.Can any one please suggest.