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

How to use APIs with JavaScript Forum

View Course » View Exercise

1471 points
Submitted by
about 5 years ago


this is my code:
// Add your code below this line!
var xhr = new XMLHttpRequest();"GET", "URL", false);
// Add your code above this line!


2 votes


There are two things that you appear to have overlooked.

The first if line 4. The second argument ought to be the URL which is the address to the server which we are making a request from. So in this example, the line should read:"GET", "", false);

Secondly, below this line, the exercise requires we .send() the request off to the server. This requires a line below line 4 which reads:


I hope this helps

EDIT: I replaced the place holder "URL" with the actual URL used in the exercise ( as modecode suggested - that'll teach me to copy-paste and not read through :)

500 points
Submitted by
Jeshua Maxey
about 5 years ago

1 Comment

52642d9437ea79ab654d4066e7ac1ed9?s=140&d=retro modecode about 5 years ago

You might also want to replace URL with the one mentioned in the task

0 votes


Hey Alex - could you modify your title to be a little more descriptive? This way others will find help from Jeshuas excellent answer too :)

978 points
Submitted by
Linda Liukas
about 5 years ago