http://www.w3schools.com/json/json_eval.asp[
^]
<script type="text/javascript">
var jA = {
"delivery_codes": [
{
"postal_code": {
"pin": 400067,
"district": "Mumbai",
"max_amount": 0,
"pre_paid": "Y",
"cash": "Y",
"pickup": "Y",
"repl": "Y",
"cod": "Y",
"sort_code": "MUM/MAL",
"is_oda": "N",
"state_code": "MH"
}
}
]
};
alert("Prepaid = " + jA.delivery_codes[0].postal_code.pre_paid);
alert("COD = " + jA.delivery_codes[0].postal_code.cod);
var json = '{"delivery_codes": [{"postal_code": {"pin": 400067,"district": "Mumbai","max_amount": 0,"pre_paid": "Y","cash": "Y","pickup": "Y","repl": "Y","cod": "Y","sort_code": "MUM/MAL","is_oda": "N","state_code": "MH"}}]}';
var jB = JSON.parse(json);
alert("Prepaid = " + jB.delivery_codes[0].postal_code.pre_paid);
alert("COD = " + jB.delivery_codes[0].postal_code.cod);
</script>