Get last string from URL with jQuery
<p>Im trying to get the last string from a URL for example...</p>

<pre><code>http://www.mywebsite/blog/this-post
</code></pre>

<p>I want to use jQuery to get 'this-post'
Ive the following...</p>

<pre><code>$('img.gigthumb').each(function(){
    var foo = $(this).parent().attr('href').split('/');
    $(this).attr('src','/lic/wp-content/uploads/2012/01/'+foo[1]+'.jpg');
})
</code></pre>

<p>only it doesn't work and I presume thats because I have multiple '/' within the URL, any idea how to target just the last? </p>

<p>Hope this makes sense! </p>
