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 AJAX Basics Programming AJAX Processing JSON Data

Attempted on my own and I have the information displaying correctly but the console shows an Uncaught TypeError?

https://w.trhou.se/fouf2f35h8

Hello all, I tried to figure this out on my own before watching the whole video. I have the information that is needed to be displayed on the website accordingly but when I open up the console, I get an error that says:

Uncaught TypeError: Cannot read property 'inoffice' of undefined at XMLHttpRequest.xhr.onreadystatechange (widget.js:17)

Is this an error that can be ignored or am I doing something wrong?

1 Answer

Nevermind, I kind of figured it out. Inside my for loop arguments, replacing xhr.responseText.length to employees.length removed the error. Though I'm still curious as to what the difference is and why the error was still given if anyone can enlighten me.