This forum is now read-only. Please use our new forums! Go to forums

0 points
about 11 years

Help!!!

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

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

Answer 50ec4b107b39d01063005188

2 votes

Permalink

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:

xhr.open("GET", "http://www.codecademy.com", 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:

xhr.send()

I hope this helps

EDIT: I replaced the place holder “URL” with the actual URL used in the exercise (http://www.codecademy.com) as modecode suggested - that’ll teach me to copy-paste and not read through :)

points
Submitted by Jeshua Maxey
about 11 years

1 comments

modecode about 11 years

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

Answer 50f6d260e47ebf93bf004d52

0 votes

Permalink

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

points
Submitted by Linda Liukas
about 11 years