I am trying to fill a HTML Dropdown menu with data from an external JSON file, which contains the following
{
\"Destinations\": [
{
\"destinatio
Consider you have got the response from server like
{
"Destinations": [
{
"destinationName": "London",
"destinationID": "lon"
},
{
"destinationName": "New York",
"destinationID": "nyc"
},
{
"destinationName": "Paris",
"destinationID": "par"
},
{
"destinationName": "Rome",
"destinationID": "rom"
}
]
}
Then your next step should be iteration of that json
$.each(data.Destinations, function(key, val) {
items.append('');
});
YOu can see the demo here Fiddle Demo