http://jster.net/library/parsedurl
semplice libreria javascript per effettuare il parser di un url
Example
var url = "https://a.complex-url.com:8080/users/jon/messages?q=cake&when=recent#searchbox""; var purl = new ParsedURL(url);
var hostname = purl.hostname;
var scheme = purl.scheme;
var port = purl.port;