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:
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?Code:var url = 'images/slideshow/fall1.png'; alert(url); $.ajax({ url:url, type:'HEAD', error: function(){ alert('No image found.'); }, success: function(){ alert('Image found.'); } });



Reply With Quote
Bookmarks