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

banner
Close banner
0 points
Submitted by textPro79927
over 9 years

16/19 NEED HELP

// Add your code below this line! var xhr = newXMLHttpRequest(); var xhr.open(“GET”,”http://www.codecademy.com/",false); var xhr.send();

// Add your code above this line!

console.log(xhr.status); console.log(xhr.statusText); CAN ANYONE PLEASE TELL WHAT IM DOING WRONG??. IT SI TELLING ME THAT I NEED A SEMICOLON??

Answer 55ad518d76b8febc76000375

6 votes

Permalink

The code in the second line should be: xhr.open(“GET”, “https://www.codecademy.com/“, false); The differences is that the address in the original code started with http instead of https.

This works:

var xhr = new XMLHttpRequest(); xhr.open(“GET”, “https://www.codecademy.com/“, false); // Add your code below! xhr.send(); console.log(xhr.status); console.log(xhr.statusText);

points
Submitted by Fabio_Mario
over 8 years

1 comments

Kyle Mitchell over 8 years

This one works. they should really fix that.

Answer 5431ae3752f8639077005af4

2 votes

Permalink

I think the issue is that you’re calling the variable (“var”) multiple times - you should just use “var” at the beginning.

Try this: var xhr = newXMLHttpRequest(); xhr.open(“GET”,”http://www.codecademy.com/",false); xhr.send();

points
Submitted by David Hamilton
over 9 years

2 comments

Noah C over 9 years

you forgot a space David change it to this: var xhr = new XMLHttpRequest();

rchdg888 about 9 years

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

// Add your code above this line!

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

Answer 545687b08c1cccbb480052ee

2 votes

Permalink

This one is working fine for me:

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

console.log(xhr.status);
console.log(xhr.statusText);
points
Submitted by virtualarrow
over 9 years

Answer 54f37a0193767630ac004c6a

1 vote

Permalink

Your problem was when you said newXMLHttpRequest(); You were suppose to space out new like so new XMLHttpRequest();

points
about 9 years

Answer 548866e186f5528e42002199

0 votes

Permalink

None of the above seem to be working for me… any ideas ?! Console still shows: “NetworkError: Failed to execute ‘send’ on ‘XMLHttpRequest’: Failed to load ‘http://www.codeacademy.com/‘.”

Connections seems good though

points
Submitted by Pierre Tlm
over 9 years

4 comments

chetan4664 over 9 years

its codecademy not codeacademy :)

smellylaundry about 9 years

i tried everything else but that, its codecademy. lol

smellylaundry about 9 years

i feel so dumb

Eryc da Silva almost 9 years

had the same issue… HAHA

Answer 549872ec51b887614c007dd3

0 votes

Permalink

Try this one

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

// Add your code above this line!

console.log(xhr.status);
console.log(xhr.statusText);
points
over 9 years

Answer 54a3cad176b8fec921018d6f

0 votes

Permalink

Same not working for me too.

points
Submitted by chetan4664
over 9 years

Answer 54a3ce0586f552face019230

-1 votes

Permalink

It is codecademy. Holu fuck all this while I thought it was codeacademy. What a way to teach students about the site itself.

points
Submitted by chetan4664
over 9 years

1 comments

Maxie327 about 9 years

Watch the language :):):):):):) jk

Answer 5438c92980ff33aecc000d51

-2 votes

Permalink

give space after ‘new’ keyword var xhr = new XMLHttpRequest();

points
Submitted by sam_topper
over 9 years