This forum is now read-only. Please use our new forums! Go to forums
Having issues with 4.2
Hey all–
Can you please help? Not sure why I’m getting this incorrect:
// 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);
Thanks! BG
Answer 50f5a35811c11bfcef000961
1 vote
You are right up to where you need to include the variable name, xhr, in the .send
var xhr = new XMLHttpRequest(); xhr.open(“GET”, “http://www.codecademy.com/“, false); xhr.send(xhr); console.log(xhr.status); console.log(xhr.statusText);
Answer 51095207568527d43c000c39
Answer 50f5829a006eee38fd004d43
0 votes
my code which worked looked exactly the same but one point, the “var xhr” part was just “xhr” for me. Hope that will woork for you.
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
3 comments
Dang– still doesn’t work. Do you mind copying your code into here please?
copy the url exactly as in the example, or above, the url is not codeacademy, but codecademy.
Yes, had the same problem. I thought the URL was “codeacademy” and once changed to “codecademy” it worked fine.