i started to learn json and ajax and i have this json file:
{
"data": {
"children": [{
"data": {
"domain": "some.url.com"
},
{
"data": {
"domain": "another.url.com"
}
}
}]
}
}
How i get the first domain from this file?
I try:
$(document).ready(function(){
$.getJSON("https://myurl.com/api.json", function(data){
console.log(data.children[0].data.domain);
});
});
and it didn't work :(