Reputation: 1378
I'm pretty sure i'am almost there....but i cannot figure out how to iterate through json objects and fill a dropdown list. Here is the js code:
My JSON data returned:{"name":"County1","name":"County1","name":"County1"}
i'm sure is something simple but as i am a newbie on this i'm not beeing able to get it work.
Appreciate your help guys!
Br, Teixeira
Upvotes: 0
Views: 3439
Reputation: 943548
Your JSON data is invalid. You can't have multiple instances of the same property in an object.
You probably want:
[
{
"name": "Country1"
},
{
"name": "Country1"
},
{
"name": "Country1"
}
]
Or even:
[ "Country1", "Country1", "Country1" ]
You can loop over it as per the example for for
in the spec.
Upvotes: 2