Here is a small cross-browser JavaScript class, which is using the HTMLAnchorElement interface to convert URI string into a serialized JSON object. The JSON object returned by the function contains hash, host, hostname, key-value array map of get parameters, pathname, port and protocol and the uri itself. uriToJSON() works with all major browsers (Firefox, Chrome, Safari, … Continue reading “JavaScript URI to JSON Serializer”