Jquery extract from url
<p>I have a string like this "/blog/post1/"</p>

<p>how can i get the "post1" from this string in Jquery ? </p>

<p>I tried this but it returned empty.</p>

<pre><code>var post_slug = $(this)[0].pathname.substring($(this)[0].pathname.lastIndexOf("/")).replace(/^\//, "");
</code></pre>
