Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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