$('#myClick2').change(function () {
if (this.checked) {
$.getJSON('message_center_getMessageLists.asp', {}, function (json) {
$.each(json.items, function (i, item) {
alert(item.rank.distID);
alert(item.rank.name);
alert(item.rank.description);
});
})
.error(function () {
alert("There was an error while trying to make this request; If it persists please contact support");
});
}
});
I cannot seem to get the above to work, I have to be missing something.
Below is the Json I am trying to loop through
{
"rank": [
{
"distID": "1",
"name": "John Doe",
"description": "My Rank"
},
{
"distID": "2",
"name": "Jane Dow",
"description": "My Rank"
},
{
"distID": "3",
"name": "Robin Doe",
"description": "My Rank"
},
{
"distID": "4",
"name": "Ryan Doe",
"description": "My Rank"
}
]
}
it looks like you might want:
?