lundi 4 avril 2016

Unable to load JSON (Javascript)

I'm trying to load a json file by link, and then align data (like title, date etc) to variables so I can use them. Right now, I dont care about variables so I just want to alert() them, but something seems like i am doing it wrong, alert returns nothing!

I use JSfidle to run the code. The code is this :

var JSON_unparsed = $.getJSON('http://ift.tt/1XcoS3v') ;

var JSON = JSON.parse(JSON_unparsed) ;

alert(JSON.feed.entry[0].title.$t) ;

the url I want to parse is : http://ift.tt/1XcoS3v

and here you can see the json how is structured if that can help you :click here (imgur)




Aucun commentaire:

Enregistrer un commentaire