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

How to use APIs with JavaScript Forum

View Course

525 points
85aa43e1b368f18c91d7130770b5f329?s=140&d=retro
Submitted by
Irek Romaniuk
over 2 years ago

in Youtube API NetworkError: Failed to execute 'send' on 'XMLHttpRequest'

got this error in in Youtube API
NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://www.codecademy.com/'.
code below is fine ?
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://www.codecademy.com/", false);
// Add your code below!
xhr.send();
console.log(xhr.status);
console.log(xhr.statusText);


5 votes

permalink

Change line 2 to "https" instead of "http"

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

everything else should be OK

317 points
Picture
Submitted by
Terry
over 2 years ago


0 votes

permalink

I'm getting it too on the Soundcloud JS API

311 points
5b04cb79ac33f0fafd86da58e3667e3f?s=140&d=retro
Submitted by
jtriv83_55938d15e39efef1300000db_del
over 2 years ago


0 votes

permalink

I'm getting the same error. I just have to continue through the menu options.. :/

372 points
Picture
Submitted by
Yuyo Severi
over 2 years ago


0 votes

permalink

Same here

336 points
Picture
Submitted by
Julio Jiménez Solano
over 2 years ago


0 votes

permalink

same here

41 points
56d12adae894960315aa93ebd856d1b9?s=140&d=retro
Submitted by
athomasse
over 2 years ago