I am watching a youtube tutorial about loading JSON from urls and tried :
function setup() {
loadJSON("http://api.open-notify.org/astros.json", gotData,'jsonp');
}
function gotData(data)
{
for(var i = 0; i<data.number;i++)
print(data.people[i].name);
}
I am getting error :
*p5.js says: It looks like there was a problem loading your JSON file. Try checking if the file path (http://api.open-notify.org/astros.json) is correct, hosting the file online, or running a local server. (More info at https://github.com/processing/p5.js/wiki/Local-server) *
What is the problem ?