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(\
Javascript has the function split associated to string object that can help you:
var url = "http://mywebsite/folder/file"; var array = url.split('/'); var lastsegment = array[array.length-1];