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

How to use APIs with JavaScript Forum

View Course » View Exercise

455 points
Submitted by
almost 5 years ago

What is going on?!

//This is what I put as my answer and I receive the output 200 instead of 404:
var xhr = new XMLHttpRequest();"GET", "", false);
// Add your code below!

7 votes


someone named themself doesntexist so has become the url to their profile page. Change"GET", "", false); to something like"GET", "", false); which you can be sure doesn't exist.

805 points
Submitted by
almost 5 years ago


51540e77784bbd8d5d000aa3_690552298 Shieh Min Kwai almost 5 years ago

I had the same problem,and thank you for solving it.And I also want to know how it works . Can you explain it for me? Thanks!!!

Picture RaBind almost 5 years ago

visit and you can see that someone named, themselves "doesntexist" making their profile page "", so the page actually exists now. That's why it returns 200 instead of 400.

520a4722f10c60998d002ae7_771003059 Philip Sagra almost 5 years ago

Good catch @RaBind. I shoulda noticed it when it returned 200, OK. It means that the page does exist.

Picture Damian Saunders almost 5 years ago

Phew! Thanks for that…I was going nuts