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 AJAX Concepts A Simple AJAX Example

Isn't working for some reason

No error in console

  <script>
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function () {
      if (xhr.readyState === 4) {
        document.getElementById('ajax').nnerHTML = xhr.responseText;
      }
    };
    xhr.open('GET', 'sidebar.html');
    xhr.send();
  </script>

1 Answer

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Data Analysis Techdegree Graduate 45,998 Points

Hey michael apprich ! :wave:

I do notice there is a missing 'i' in innerHTML on what would be line 5 of what you posted. I haven't tried running your code yet, so if you continue having issues, let us know!

Thanks Travis Alstrand. That's frustrating. I guess I couldn't see it because I missing my i. Buh-dum, tiss. Should that have caused an error, though?

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Data Analysis Techdegree Graduate 45,998 Points

Haha!! Nice one! :smile:

I would think it should have gotten to that part of that line of code and thrown an error stating that it doesn't recognize nnerHTML as a function. There has been times where sneaky things like this happen and don't produce an error in the console though.

I'm not sure if you use Visual Studio Code as a text editor, but they have a great extension named Code Spell Checker that will warn you of things like this and make typos much easier to catch. :smiley: