Json Object List.
-------------------------
var params = new Object();
params.Id = personId;
params.cls = Class;
$.ajax({
type: "POST",
dataType: "json",
data: $.toJSON(params),
contentType: "application/json",
url: "../OtpWebService.asmx/GetStudentDetails",
alert(response.d);
}
});
The out-put, when i do alert(response.d); is given below.
actually this is an json object returned by a above code from c#.
[
{"Name":"Nthal","Class":3,"SubjectName":"English "},
{"Name":"Mishal","Class":4,"SubjectName":"Grammer"},
{"Name":"Sanjeev","Class":3,"SubjectName":"Social"},
{"Name":"Michal","Class":5,"SubjectName":"Gk"},
]
if i try alert(response); the result will be just --> [object] [object]. How can i iterate through each element in this object list and and print through document.write..?