I am trying to display a JSON array in HTML which I get as response is
[
{
"New upto 3 Yrs": 40.0,
"Above 3 yr to 9 yrs": 35.0,
"Above 9 yrs upto 12 yrs": 30.0
}
]
here i am getting value undefined. (see snap shot
)
How can I display this kind of JSON in HTML as a html table?
here is my script:
success: function (data) {
if (objMotorUnderwritingList.ddlVehicleType == "TW$") {
// alert("hi TW$");
if (data.jsDiscoundGridList != 0) {
var eachrow = "<tr>"
+ "<td>" + data.jsDiscoundGridList[0]["New upto 3 Yrs"] + "</td>"
+ "<td>" + data.jsDiscoundGridList[0]["Above 3 yr to 9 yrs"] + "</td>"
+ "<td>" + data.jsDiscoundGridList[0]["Above 9 yrs upto 12 yrs"] + "</td>"
+ "</tr>";
$('.tbody').html(eachrow);
}
else {
ShowAlert("Something Wrong in TW");
}
}}
spaces(in keys) issue to me