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 Handling Errors

Nour El-din El-helw
Nour El-din El-helw
8,241 Points

"checkStatus" undefined

For some reason I'm getting this error : Uncaught ReferenceError: checkStatus is not defined at fetchData (app.js:11) at app.js:16 here is a snapshot of my workspace: https://w.trhou.se/ugbjawuhyq . Thanks in advance :D

Seems like this is because you declare checkStatus after these lines occur

I ran this code in Firefox and got the following error: "ReferenceError: can't access lexical declaration `checkStatus' before initialization." Perhaps this might give you a better idea on where to start.

[update: seems like Jackson has the same idea]

Nour El-din El-helw
Nour El-din El-helw
8,241 Points

hmm..weird I also declared generateOptions and generateImage before I used them but it didn't return an error. Also somehow when I copied the code in the snapshot to my own text editor and used a local server it worked normally. Anyways, thanks for your time guys! :D