I’m trying to use Worknik’s API to iterate each “text” definition of a given word with a limit of say 3 (limited in URL param) by fiddling with JS and the API here: http://jsfiddle.net/p4xF3/2/ I can get the object I want to console.log out but cannot seem to use the correct syntax to drill down into the array called json and iterate for each “text” node (definition of a given word). I would like to append these results to the div in the code. This probably makes little to no sense, but I think I will be clearer if you have a look at my JSfiddle link above and search for an English word against the Wordnik API using the code which is there. Checking the console after, you should see what I mean. Thanks in advance for your help! 🙂
Share
You are getting an array of json objects back, so you will have to iterate over that and pull out the “text” from each object. You are basically doing that already when you use your jquery each function, but you could change that to a more traditional loop like this: