Although there are similar questions posted, my specific issue is that I am unsure of where to place certain information. My goal is to restrict the number of items fetched from a list within the script provided below. The actual script functions correctly, but I need assistance in limiting the retrieval to only six items instead of retrieving everything. While this may seem like a simple task, none of the code snippets I tried from other sources worked for me. Any suggestions?
(function($){
$.ajax({
type: "GET",
url: "/homepage_photo_slider/PhotoGallery.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('img').each(function() {
var location = '/homepage_photo_slider/';
var url = $(this).attr('src');
var alt = $(this).attr('alt');
$('<li></li>').html('<a href="'+location+''+url+'" class="pirobox" rel="gallery" title="'+alt+'"><img class="thumb" src="'+location+''+url+'" alt="'+alt+'" title="'+alt+'" /></a>').appendTo('#gallery-ul');
});
$().piroBox_ext({
piro_speed : 700,
bg_alpha : 0.5,
piro_scroll : true
});
}
});
})(jQuery);