I am trying to fill a HTML Dropdown menu with data from an external JSON file, which contains the following
{
\"Destinations\": [
{
\"destinatio
Try this code :
$.getJSON('yourfile.json', function(data) {
destinations = data['Destinations']
$.each(destinations, function(id, destination) {
destination = destination["destinationName"]
alert(destination)
})
});
It allows you to get the destination value in the destination variable, for, after, can do everything with values of this variable.