modifié : SRC/public/js/ListeOeuvre.js
This commit is contained in:
parent
3a980e247b
commit
caed3d7972
@ -7,21 +7,23 @@ $('.listeoeuvre').click(function(event) {
|
|||||||
url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val();
|
url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val();
|
||||||
|
|
||||||
|
|
||||||
var req = new XMLHttpRequest();
|
var r = new XMLHttpRequest();
|
||||||
req.onload = function(e) {
|
r.open("GET", url, true);
|
||||||
var data = req.reponse;
|
r.onreadystatechange = function () {
|
||||||
|
if (r.readyState != 4 || r.status != 200)
|
||||||
|
return;
|
||||||
|
var data = JSON.parse(r.response);
|
||||||
if (data.length == 0 )
|
if (data.length == 0 )
|
||||||
|
|
||||||
$("#oeuvrePic").append("Aucune Oeuvre");
|
$("#oeuvrePic").append("Aucune Oeuvre");
|
||||||
data.forEach( function(el) {
|
for (el in data)
|
||||||
|
{
|
||||||
$("#oeuvrePic").append('<div class="col-xs-4 col-md-3">'
|
$("#oeuvrePic").append('<div class="col-xs-4 col-md-3">'
|
||||||
+'<a href="#" class="thumbnail">'
|
+'<a href="#" class="thumbnail">'
|
||||||
+'<img src="http://www.augustins.org/documents/10180/156407/' + el.urlPhoto + '"/>'
|
+'<img src="http://www.augustins.org/documents/10180/156407/' + data[el].urlPhoto + '"/>'
|
||||||
+'</a></div>');
|
+'</a></div>');
|
||||||
});
|
}
|
||||||
req.open('GET', url, true);
|
};
|
||||||
req.send();
|
r.send();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user