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

AJAX not getting into action. getting "Not Found The requested URL /sidebar.htlm was not found on this server." error

i have been following along in workspaces but when i launch my preview for the AJAX to get into action i get an error code saying

"Not Found The requested URL /sidebar.htlm was not found on this server."

var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function (){
if (xhr.readyState === 4){
document.getElementById('ajax').innerHTML = xhr.responseText;
}

};

xhr.open('GET', 'sidebar.htlm');
xhr.send();

That is how my code looks like in my htlm

2 Answers

Zoltán Holik
Zoltán Holik
3,401 Points

you had a mistype. :) .html not .htlm

//mistyped code
xhr.open('GET', 'sidebar.htlm');

//fixed code
xhr.open('GET', 'sidebar.html');

ohhh i had missed that. Thanks a lot