How do I get the last segment of a url? I have the following script which displays the full url of the anchor tag clicked:
$(\".tag_name_goes_here\").live(\
var pathname = window.location.pathname; // Returns path only var url = window.location.href; // Returns full URL
Copied from this answer