Baca Hasil Json_encode PHP dengan Jquery

this is sampe code in php for encode data array to json with json_encode function

// kode di php
$data = array();
foreach($result as $key => $row) {
$record = array();
$record["nim"] = $row["nim"];
$record["nama_lengkap"] = $row["nama_lengkap"];
$data[] = $record;

echo json_encode($data);


to parse json ajax results in jquery is as follows

url: "/exam/url",
type: 'post',
crossDomain: true,
cache: false,
data: 'param=' + param,
//data setelah downloaded 
//dan pass downloaded data
var json = $.parseJSON(response);
//now json variable contains data in json format
//let's display a few items
for (var i=0; i < json.length; ++i) {


hopefully useful, wassalam