My JSON objects look like this:
[{
"aid": "1",
"atitle": "Ameya R. Kadam"
}, {
"aid": "2",
"atitle": "Amritpal Singh"
}, {
"aid": "3",
"atitle": "Anwar Syed"
}, {
"aid": "4",
"atitle": "Aratrika"
}, {
"aid": "5",
"atitle": "Bharti Nagpal"
}]
As you can see the names are differentiated through their associated aid’s. Now suppose I want to display the name stacked with aid: 4. what js should i write for that?
You could loop over the elements of your array, testing, for each one, if its aid is 4 :
Will give an alert with “
Aratrika“