my first alert shows the list of items but the second is not. I've never done anything in ajax/js before so i don't know how to return my array so it would be visible by other functions.
var mycarousel_itemList = [];
$(document).ready(function () {
    $.ajax({
        type: "GET",
        url: "xml/images.xml",
        dataType: "xml",
        success: function (xml) {
            $(xml).find('image').each(function () {
                var id = $(this).attr('id');
                var url = $(this).find('url').text();
                mycarousel_itemList.push('{url:"' + url + '",' + 'id:"' + id + '"}');
                alert(mycarousel_itemList);
            });
        }
    });
    alert(mycarousel_itemList);
});
This is how my xml looks like
<images>
  <image id="1">
    <title>item</title>
    <url>images/image.gif</url>
    <desc>description of an item</desc>
  </image>
  <image id="2">
     <title>anotheritem</title>
    <url>images/images.gif</url>
    <desc>description of an item</desc>
  </image>
</images>
 
     
     
    