JavaScript AJAX Basics (retiring) AJAX and APIs Stage 4 Challenge Answer

AJAX Basics Stage 4 project not working?

The "Displaying the Photos" project in video 6 of AJAX Basics Stage 4 does not seem to be working. I followed along with project videos and entered code as instructed into workspace with no success. Loading "finished" project files provided did not work either.

4 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Hi Scott Hetrick

Have you checked the JavaScript console in your browser? Are there any error messages? Try loading the index.html file from the stage4-->video6-->finished folder into your browser, click one of the buttons and looking in the console for any errors.

Anthony Cortez
Anthony Cortez
7,593 Points

Hi Scott, I was also having trouble after following along, but I caught my mistake. I named a variable flickrAPI instead of flickerAPI. Check if that letter "e" is matching.

Dave, Great suggestion. Should have thought of that myself. I compared the original and "finished" files. I see that in the original the flickrData var is not defined ($.getJSON(flickerAPI, flickrData, displayPhotos);). However, in the "finished" files we have ($.getJSON(flickerAPI, flickrOptions, displayPhotos);) and var flickrOptions is defined.

So loading the finished files directly into the browser works.

However, when I review the work I did in workspaces, the code is correct ($.getJSON(flickerAPI, flickrOptions, displayPhotos);) with var flickrOptions defined, but for some reason it's returning a flickrData var is not defined error.

I'll just put it down as a glitch with workspaces. Thanks very much for your response.

Dave McFarland
Dave McFarland
Treehouse Teacher

I'll look into this @scott hetrick. Thanks for following up on this.