Con jquery cerco di recuperare le img dal file getImages che risiede nella cartella ../chapter_06/08_ajax_image_gallery_improved/
Però le immagini non si caricano.
codice:var GALLERY = { container: '#gallery', url: '../chapter_06/08_ajax_image_gallery_improved/getImages', delay: 5000, load: function() { var _gallery = this; jQuery.ajax( { type:"get", url: '../chapter_06/08_ajax_image_gallery_improved/getImages', beforeSend: function() { jQuery(_gallery.container) .find('img') .fadeOut('slow', function() { jQuery(this).remove(); }); }, success: function(data) { var images = data.split('|'); jQuery.each(images, function() { _gallery.display(this); }); }, complete: function() { setTimeout(function() { _gallery.load(); }, _gallery.delay); } }); }, display: function(image_url) { jQuery('<img></img>') .attr('src', '../images/' + image_url) .hide() .load(function() { jQuery(this).fadeIn(); }) .appendTo('#gallery'); } } jQuery(document).ready(function(){ GALLERY.load(); });

Rispondi quotando