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

204 points
50ea168f1990f4d0b8001383_397725238
Submitted by
Onur Şentüre
over 4 years ago

Why do I get XMLHttpRequest exception?

// Add your code below this line!
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://www.codeacademy.com/", false);
xhr.send();

// Add your code above this line!

console.log(xhr.status);
console.log(xhr.statusText);

and it gives the exception? can anyone help me? thank you.


10 votes

permalink

sorry, i'm poor in english;

Address of site is wrong!
you should type:
"http://www.codecademy.com"

not codeAcademy

1641 points
E9208c4a1df963917bd2957c207fe519?s=140&d=retro
Submitted by
Masoud Kazemi
over 4 years ago

7 Comments

5123e9f9a1420d45770025c9_136540607 Jarrett Streebin over 4 years ago

My English is fine (I think) and I missed this one for the same reason!

5066ff81790260000204250c_42504638 Bruce over 4 years ago

I made exactly the same typo.

Picture Brandon Ashton over 4 years ago

Yeah, this got me too. I had to copy/paste to realize that I had the extra letter.

Db4b131b1b1519a5a22f84b1e8737f9b?s=140&d=retro Mark Heath about 4 years ago

ran into same problem here. Also I had a comma instead of a dot. Caused a very strange error.

9e3ac211ebf298b64924b1eca1b3efea?s=140&d=retro fettabachi about 4 years ago

I just learned the name of the site.

Picture Shane Tjong almost 4 years ago

haha, wow fell for this one too.

50ea168f1990f4d0b8001383_397725238 Onur Şentüre over 3 years ago

Thank you :D


0 votes

permalink

Can Qnur post the exception content?

36 points
Dfbf954d4372a34731634a076e52b6e6?s=140&d=retro
Submitted by
flybird365
over 4 years ago


0 votes

permalink

Same mistake here. Spent 15 minutes trying to debug. Was absolutely dumbfounded, haha.

1342 points
9fac5fafbfbd2c2b016a44805acf4a94?s=140&d=retro
Submitted by
Goer Tan
almost 4 years ago


0 votes

permalink

Wohh!! That's really sad. :)

204 points
50ea168f1990f4d0b8001383_397725238
Submitted by
Onur Şentüre
over 3 years ago