JavaScript AJAX Basics (retiring) Programming AJAX Processing JSON Data

Minh Le
PRO
Minh Le
Pro Student 3,296 Points

I typed what Dave has but I don't have the same output. Can you please help me? https://w.trhou.se/dramznskhv

I typed what Dave has but I don't have the same output. Can you please help me? https://w.trhou.se/dramznskhv

5 Answers

Sean T. Unwin
MOD
Sean T. Unwin
Treehouse Moderator 28,304 Points

I've tried in Chromium and Firefox with similar results.

If the browser window is narrow enough the list will display below the paragraphs so you will have scroll down to see it.

Furthermore, have you looked at Chrome's Developer Tools (Ctrl + Shift + J) to see if there are any errors displayed? In the Console of the Dev Tools type, xhr and see the results, particularly xhr.response.

Sean T. Unwin
MOD
Sean T. Unwin
Treehouse Moderator 28,304 Points

You're going up a level for the path of the JSON file:

xhr.open('GET', '../data/employees.json'); 
//               ^-- Note the '../' segment at the beginning of the second parameter

/* Should be */
xhr.open('GET', 'data/employees.json');
Minh Le
PRO
Minh Le
Pro Student 3,296 Points

Hi Sean,

Thank you for your answer. But as you can see in my code, I do have what you suggested: xhr.open('GET', 'data/employees.json');

Sean T. Unwin
Sean T. Unwin
Treehouse Moderator 28,304 Points

What output are you getting?

I forked the Workspace and I am getting the expected output.

Minh Le
PRO
Minh Le
Pro Student 3,296 Points

Wow really! All I get is just the html paragraghs and no sidebars. Strange! Do you think it's the browser I am using? I use Google Chrome. Thanks so much for your help.

Minh Le
PRO
Minh Le
Pro Student 3,296 Points

You are right Sean. It's at the bottom of the page. Thank you very much for all your help. Is there something I need to do on this site to give you the credit for helping me? Thanks so much again.