The only way to get this call to work is with a typo


#1

This one had me stuck for a week. I'd give up and come back and then finally came to the forums. For anyone also frustrated, it turns out there is a typo in the lesson when checking the code. To get this to work the URL needs to be "https://www.codecademy.com/" and NOT "https://www.codeacademy.com"


#2

Makes sense to me since that's the correct URL?

And the name of the site?

:thinking:


#3

it keeps on telling me oops, try again. and i have the same exact code…


#4

What seemed to work for me was clicking the Reset code and then entering the console.log function again as required.
However this is under the precondition that I had already done this course in the past, and entered the correct answer and for some reason coming back to that page again and hitting “Save and Continue” no longer gave the correct answer.


#5

ALso, The Hint doesn’t include xhr.send(); that’s what got me stuck.


#6

I’m trying to run through the course, but I’m stuck on this, too. I’ve tried http and https with no change. Refreshed page, reset code, manually typed in code, copy + past code from the hint…nothing.

What’s going on here? How do I fix this issue?

It keeps telling me i didn’t console log the xhr.statusText

Here’s my code:
var xhr = new XMLHttpRequest();
xhr.open(“GET”, “https://www.codecademy.com/”, false);
// Add your code below!
xhr.send();
console.log(xhr.status);
console.log(xhr.statusText);

UPDATE!
Read this: #5 https would not pass it alone
Basically, I console logged “OK” instead of the xhr.statusText, and it worked. The course verifies the console log output, so I made it the answer it wanted to hear (even though the code wasn’t what it should have been)