Converting from HTML images to XML images

Converting from HTML images to XML images

I am both learning how to use AJAX as well as trying to replace code that uses hard coded HTML images to one that will read an XML file using Jquery AJAX.  My currently working HTML page is  here.

For leaning, I reduced the page code down to  this.

The AJAX code was copied from something I have working, though it is a very simple learning page.  My first stumbling block is understanding what is being stored in the variable, "img":  Does it contain the "imageURL", "alt" and "comment" for all of the images or just one?

My second question, which may be related to my first, is why isn't "ct" being increment?

  1.       $.ajax({
  2.         type: "GET",
  3.           url: "xml/photos.xml", //xml file 
  4.           dataType: "xml",
  5.           success: function(xml) {
  6.             ct = 0;
  7.             $(function(){
  8.             $(xml).find('slide').each(function() {
  9.             var img=$('<img>',{
  10.             src:$('imageURL',this).text(),
  11.             alt:$('alt',this).text(),
  12.             comment:$('comment',this).text()
  13.             })
  14.             ct++;  /* This does not increment */
  15.             })
  16.             })
  17.           } /* Success */
  18.        })

Waiting for my Jquery book to arrive...

Todd