Is there anything in JS that corresponds to java's java.net.URL object?
The location object does the work but i would like to create "my own" location object and not that of window.location. And you can't do "var url = new Location("http://whatever.com
")" can you?
I'm interested in the location methods .port, .host, path etc and would like a JS api to get the different parts of an url similar to java's URL. See java code ex below...
java.net.URL url = new java.net.URL("http://www.domain.com/path/file.html?param=value");
String host = url.getHost(); // returns "www.domain.com"
int port = url.getPort(); // returns 80
String query = url.getQuery(); // return param=value
String path = url.getPath(); // returns /path
.. etc etc