I am trying to get json data from url. Here's the js
var myRequest = new XMLHttpRequest();
myRequest.open('GET', 'URL that has JSON format');
myRequest.onload = function() {
var myData = JSON.parse(myRequest.responseText);
console.log(myData);
};
myRequest.send();
The JSON data format is like this
"ING":
[
{
"#":1,
"Team":"Manchester City",
"Main":37,
"Poin":97
},
{
"#":2,
"Team":"Manchester United",
"Main":37,
"Poin":78
},
{
"#":3,
"Team":"Tottenham Hotspur",
"Main":37,
"Poin":74
},
{
"#":4,
"Team":"Liverpool",
"Main":37,
"Poin":72
},
{
"#":5,
"Team":"Chelsea",
"Main":37,
"Poin":70
}
]
}
for example i want to fetch Chealsea. How can i achieve that? i know that i have to change
console.log(myData);
What should i do? Thanks