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 Finish the AJAX Request

AJAX Concepts Challenge task 1 of 2

var request = new XMLHttpRequest();
request.onreadystatechange = function () {
  if (request.readyState === 4) {
    document.getElementById("footer").innerHTML = request.responseText;
  }
};

xhr.open('GET', footer.html);

Trying to open AJAX request using above. It's not passing the challenge. Can anybody give me a hint? Thanks

2 Answers

There is only a naming issue. Use request instead of xhr and add quotes around to footer.html like below

request.open('GET', 'footer.html');

I figured it out. I feel like an idiot. Thank you though.