How to retrieve status field from json file using text field as source for identificator code?
My data.json file:
[{
"code":"001",
"status":"ready"
},
{
"code":"002",
"status":"not ready"
}
]
My jquery file:
$(document).ready(function() {
$('#ticketsearch').click(function() {
var ticketcode = $('[name=ticketcode]').val();
$('.ticket').text(ticketcode);
$.getJSON('data.json', function(data) {
$('.status').text(data.status);
});
});
});