I am having problems remembering how to loop through an object to manipulate it into options in a select form object. I have gotten this far but the alert from inside the success function simply prints "object Object". I have done this before but I am just rusty and any help is appreciated.
function getDestinations()
{
$.ajax({
dataType:'json',
type:'GET',
url:"json/destinations.json",
success:function(data) {
for (var dest in data.Destinations) {
alert(dest.destinationName)
}
}
});
}
The alerts are coming up as "undefined" but they are looping the correct amount of times.
For more information, each returned result is to populate a dropdown list that will in turn be used, when selected, to populate a div with weather information for said selected location using its "destinationID".