I have Json of the form
[{"id":39,"data":1},{"id":40,"data":2}]
It does not parse properly with jQuery.parseJSON()
I need to take this data and create a html table
. I was thinking of creating the HTML dynamically in the js.
A. How can I parse the json?
B. Is dynamic html the best route?
Update
I apologize. Evidently my question is not clear. Here is the jquery
$.get('Service.aspx',
{ p1: value, p2: value },
function (data) {
notesJson = data;
alert(notesJson);//Json comes back as I said here...
var noteSet = jQuery.parseJSON(notesJson);
alert(noteSet.notes);
});
notes does exist in the Json.
The second alert fails "undefined".
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…