HTML:
You can use javascript function sort() or reverse()
var data = $.parseJSON($('#sdata').val()); data.reverse(); $.each(data, function(id, sc) { alert(id); }