I have json result as follow:
{"Result":"OK","Records":[{"impTxnId":12231,"forecastedId":26518},
{"impTxnId":12231,"forecastedId":26519}]}
How do I iterate over Records? I want impTxnId
and forecastedId
values.
Code:
$(function(){
var request = $.ajax({
url: '<%=getMatchedTransactionsURL%>',
type : "post",
});
request.done(function (data) {
alert(data); // This displays the data.
$.each(data.Records, function(i, record) {
alert(record.impTxnId + " " + record.forecastedId);
});
});
});