In Java, given a java.net.URL or a String in the form of http://www.example.com/some/path/to/a/file.xml , what is the easiest way to g
java.net.URL
String
http://www.example.com/some/path/to/a/file.xml
I have the same problem, with yours. I solved it by this:
var URL = window.location.pathname; // Gets page name var page = URL.substring(URL.lastIndexOf('/') + 1); console.info(page)