Using RegEx to look for images in a particular URL location

The following code sets the variable “url” to be initialized to a single image file location relative to where this script runs and from there, simply fires off a function if it exists or doesn’t:

var url = 'images/slideshow/fall1.png';
alert(url);
$.ajax({
    url:url,
    type:'HEAD',
    error:
        function(){
            alert('No image found.');
        },
    success:
        function(){
            alert('Image found.');
        }
});

What I would like to do is have this entire script work against something like “images/slideshow/*.png” where the asterisk acts as a wildcard to synthesize directory traversal. Obviously, JavaScript / jQuery can’t do server-side ops, but could I use a RegEx somehow to fulfill this?

Never mind everyone… I found a solution:

var url = 'images/slideshow/';
$.ajax({
  url:url,
  success: function(data){
     $(data).find("a:contains(.png)").each(function(){
        aImages.push(url+$(this).attr("href"));
     });
  }
});