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 trialRichard Preske
Courses Plus Student 4,356 PointsWhen debugging, this is error I get.
jquery.js:491 Uncaught TypeError: jQuery.each is not a function at jquery.js:491 at jquery.js:36 at jquery.js:40 (anonymous) @ jquery.js:491 (anonymous) @ jquery.js:36 (anonymous) @ jquery.js:40 ial.js:164 Uncaught ReferenceError: $ is not defined at ial.js:164 (anonymous) @ ial.js:164 csl.parser.js:2044 Uncaught ReferenceError: jQuery is not defined at csl.parser.js:2044 (anonymous) @ csl.parser.js:2044 extension.js:21 Uncaught TypeError: Cannot read property 'init' of undefined at Object.init (extension.js:21) at extension.js:45 at extension.js:48 init @ extension.js:21 (anonymous) @ extension.js:45 (anonymous) @ extension.js:48 callbacks.js:13 Uncaught TypeError: callback is not a function at XMLHttpRequest.xhr.onload
Not sure why it is saying callback is not a function. It seems there is something wrong with the requested data coming from Wikipedia or astroURL.
2 Answers
Steven Parker
231,248 PointsThe snapshot allowed me to replicate the issue and find it.
So on line 31 of "callbacks.js", there's an extra closing parenthesis, probably just a typo.
Richard Preske
Courses Plus Student 4,356 PointsFIxed it, but still get error with only 2 astronauts. I get a 404 file not found error.
Steven Parker
231,248 PointsThat's not your program's fault. The API is listing a 3rd person as "Anatoly Ivanishin" (with a "y"), but the corresponding info page is under the name "Anatoli Ivanishin" (with an "i").
For a bonus exercise, you might try adding some code to make errors in looking up details a bit more graceful (like display the name and a "friendly" error message).
Steven Parker
231,248 PointsSteven Parker
231,248 PointsError messages are generally only useful when the code can be referenced, please also show the code.
Be sure to use Markdown formatting lor make a snapshot of your workspace and post the link to it here.