ludres json testing
API Allociné + Bootstrap 2.2.2
by toubia95
HTML
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js"></script>
<div id="placeholder"></div>
<div id="images"></div>
CSS
/*
API ALLOCINE http://wiki.gromez.fr/dev/api/allocine_v3
JSON Formater http://jsonformatter.curiousconcept.com/
JQUERY http://api.jquery.com/jQuery.getJSON/
*/
body {margin: 10px !important;}
JavaScript
// programme ludres en json
// http://api.allocine.fr/rest/v3/showtimelist?partner=YW5kcm9pZC12M3M&q=61282&format=json&theaters=P0683
var data={"users":[
{
"firstName":"Ray",
"lastName":"Villalobos",
"joined": {
"month":"January",
"day":12,
"year":2012,
"joined": {
"month":"January",
"day":12,
"year":2012
}
}
},
{
"firstName":"John",
"lastName":"Jones",
"joined": {
"month":"April",
"day":28,
"year":2010,
"joined": {
"month":"January",
"day":12,
"year":2012
}
}
}
]};
$(data.users).each(function() {
var output = "<ul><li>" + this.firstName + " - " + this.joined.joined.month + "</li></ul>";
$('#placeholder').append(output);
});
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
{
tags: "clouds",
tagmode: "any",
format: "json"
},
function(data) {
$.each(data.items, function(i,item){
$("<img/>").attr("src", item.media.m).appendTo("#images");
if ( i == 3 ) return false;
});
});