JavaScript AJAX Basics (retiring) AJAX Concepts A Simple AJAX Example

arik
arik
5,790 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,790 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...