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

arik
arik
5,791 Points

Bring on the AJAX Not Found The requested URL /sidebar.HTML was not found on this server.

I got that result when I previewed my code on Chrome - I used treehouse workspace.

Here is my code:

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

What's wrong with my code or why did I get the message that the sibar.html can't be found? Any help would be highly appreciated. Thank you very much in advance.

1 Answer

arik
arik
5,791 Points

I am sorry for posting question, I just found out that I wrote HTML using upper case, and changing it to lower case solved the problem, once again sorry...