You can use the [lastIndexOf()][1] function to locate the last occurrence of the `/` character in your URL, then the [substr()][2] function to return the substring starting from that location:
window.alert(this.href.substr(this.href.lastIndexOf('/') + 1));
That way, you'll avoid creating an array containing all your URL segments, as `split()` does.
[1]: http://msdn.microsoft.com/en-us/library/6d20k718.aspx
[2]: http://msdn.microsoft.com/en-us/library/0esxc5wy.aspx
You can also use the [lastIndexOf()][1] function to locate the last occurrence of the `/` character in your URL, then the [substr()][2] function to return the substring starting from that location:
window.alert(this.href.substr(this.href.lastIndexOf('/') + 1));
That way, you'll avoid creating an array containing all your URL segments, as `split()` does.
[1]: http://msdn.microsoft.com/en-us/library/6d20k718.aspx
[2]: http://msdn.microsoft.com/en-us/library/0esxc5wy.aspx