Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Working with getJSON and API's

HTML hasn't been played with yet, just a basic set up.

I have been playing with various API's to help solidify the courses presented here. I am working with the Flickr API still but, I am trying to take a word and present it using just photos. For example if you type in the word "cat" it will show a picture that is the letter C, one that is the letter A and then the letter T.

I have the code working in the console but, to a point. If I paste in all but the last two lines, everything works like it should. I then can paste the last two lines in

        placedWord = (finalWord).join('');
        $('#wordHere').html(placedWord);

and it will do it's thing and work.

However, if I paste all the code, the last two lines get ignored. I tried using an IIFE function as I saw suggested elsewhere. It didn't change anything so at this point I left it in but, will likely just remove it.

Any suggestions would be appreciated as I just can't figure out what it is I am missing.

2 Answers

Never Mind I figured out a work around.

Here is the js file separate. The HTML file really isn't necessary as it's just used to place the materials on screen.