using jQuery
:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
you have the ability to achieve something similar to this:
$.ajax({
url: 'fetch_images',
method: 'POST',
data: {}
}).done(function(data) {
//data will be the response object as specified in the query.
var container = $('#div_to_display_images');
$.each(data.slider_images, function(_, image_obj){
container.append('<img>' + image_obj.image + '</img>');
})
}).fail(function(error) {
alert('request failed');
});