JavaScript URI to JSON Serializer

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, Opera, IE6/7/8/9/10).

There is a newer and improved version of the class on this page.




Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s