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

How to use APIs with JavaScript Forum

View Course » View Exercise

349 points
B547e00a7a763d6f2a0110aeb17f7264?s=140&d=retro
Submitted by
admin6
about 2 years ago

NEED HELP WITH 2/6!

What is the final code? I tried for hours! CAN'T FIGURE IT OUT!


1 vote

permalink

var xhr= new XMLHttpRequest();
xhr.open("GET","https://www.codecademy.com/",false);
xhr.send()

// Add your code above this line!

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

1228 points
506abd81d3d908000203bdc8_409128314
Submitted by
Vikrant Negi
almost 2 years ago

2 Comments

Picture Danny Ortega almost 2 years ago

took me awhile but it has to be https might wanna send in to someone. Didnt pass without http

566354cc937676913a000061_638238020 DAGIROV Djamal almost 2 years ago

why httpS and not http ?


0 votes

permalink

try this:

xhr.open("GET", "https://www.codecademy.com/", false);

use HTTPS

892 points
54340b889c4e9d6084000695_978606649
Submitted by
HernĂ¡n
almost 2 years ago