This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
ModuleWeb/SRC/public/js/ListeOeuvre.js

29 lines
1018 B
JavaScript
Raw Normal View History

2015-02-19 14:37:52 +00:00
$(document).ready( function() {
console.log( "document loaded" );
$('.listeoeuvre').click(function() {
$('#oeuvrePic').empty();
url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val();
$.get(url, function( data ) {
if (data.length == 0 )
$("#oeuvrePic").append("Aucune Oeuvre");
2015-02-19 14:37:52 +00:00
data.forEach( function(el) {
$("#oeuvrePic").append('<div class="col-xs-4 col-md-3">'
+'<a href="#" class="thumbnail">'
+'<img src="http://www.augustins.org/documents/10180/156407/' + el.urlPhoto + '"/>'
+'</a></div>');
})
}, "json" )
.fail(function() {
$("#oeuvrePic").append('<div class="alert alert-danger">'
+'<strong>Oouups!</strong> Il y a un problème.<br><br>'
+'<ul>'
+'<li>Erreur lors de la récupération</li>'
+'</ul>'
+'</div>'
);
2015-02-19 14:37:52 +00:00
});
});
});