Query String Parser

Convert URL’s query string into JavaScript object.

Example

Input

Output

Please visit one of the links above!

Usage

q2o(query, eval = true);
<script src="q2o.min.js"></script>
<script>
var config = q2o('?foo=1&bar=2');

console.log(config); // {"foo":1,"bar":2}
console.log(config.foo); // 1
console.log(config.bar); // 2
</script>