This forum is now read-only. Please use our new forums at discuss.codecademy.com.

How to use APIs with JavaScript Forum

View Course » View Exercise

839 points
Picture
Submitted by
Manuel Falcon Talamantes
over 3 years ago

help me with this please!

var xhr = new XMLHttpRequest();
xhr.open("GET", "http://www.codecademy.com/doesnt_exist", false);
xhr.send();
// Add your code below!
xhr.status("404");
console.log(xhr.status);


1 vote

permalink

Remove this line and the rest works:

 xhr.status("404");

528 points
C0b00daa02ab12907c76f8c1b5794a65?s=140&d=retro
Submitted by
tomasdore
over 3 years ago

2 Comments

Picture Adnan Manzoor about 3 years ago

Does Not work either

var xhr = new XMLHttpRequest();
xhr.open("GET", "http://www.codecademy.com/doesnt_exist", false);
xhr.send();
// Add your code below!
xhr.status("404");

C0b00daa02ab12907c76f8c1b5794a65?s=140&d=retro tomasdore almost 3 years ago

But you have not removed that line, with the 404 in it. It is still there in your code, I see it is the last line in your code.

You have instead removed the other line. That is the opposite of the solution I suggested.