This forum is now read-only. Please use our new forums! Go to forums
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
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 :)
Answer 50f6d260e47ebf93bf004d52
Hey Alex - could you modify your title to be a little more descriptive? This way others will find help from Jeshuas excellent answer too :)
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
You might also want to replace URL with the one mentioned in the task