JavaScript Handling Errors

Nour El-din El-helw
Nour El-din El-helw
8,229 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,229 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