I am already trying for over an hour and cant figure out the right way to do it, although it is probably pretty easy:
I have something like this : foo/bar/test
foo/bar/test
var str = "foo/bar/test.html"; var lastSlash = str.lastIndexOf("/"); alert(str.substring(lastSlash+1));