Function to look through folder and use a wildcard
<p>been a lurker on Stack Overflow for a while, love the site.</p>

<p>Now its my turn. From the code below, i am making the background image random each time the page loads.</p>

<p>Would anyone be so kind as to help me make this more efficient so that i don't have to manually enter my filenames ? Im looking for some kind of wildcard function that can look through my given folder and load footer*.png or even *.png as this folder will only contain footer patterns.</p>

<pre><code>var images = ['footer.png', 'footer2.png', 'footer3.png'];

$('#footer').css({'background-image': 'url(images/footers/' + images[Math.floor(Math.random() * images.length)] + ')'});
</code></pre>
