Turning the Querystring into a JSON object using JavaScript

advertisement

advertisement

The query string in the DOM has always been a bit awkward, why there isn’t a standard method of parsing it is beyond me. The normal route most people follow is to convert it in to a simple array of Key/Value pairs. This allows you to then access the values of the query string using the array accessor syntax.