How to parse http query parameters as javascript object?
<p>I am doing something wrong. At the end of this o is empty. I want to pass in a string such as <code>a=3&amp;zz=5</code> and do o.a and o.zz to retrieve 3 and 5. How do i generate this object?</p>

<pre><code>function MakeIntoFields_sz(sz) {
    var kvLs = sz.split('&amp;');
    var o = new Array();
    for (var kv in kvLs) {
        var kvA = kvLs[kv].split('=');
        var k = '';
        var v = '';
        if (kvA.length &gt; 0) {
            k = kvA[0];
            if (kvA.length &gt; 1)
                v = kvA[1];
            o[k] = v;
        }
    }
    return o;
};
</code></pre>
