Jquery read query string
<p>I'm having trouble reading a query string with Jquery. What I want to do is read the query string and based on what it says scroll to a certain place or element.</p>

<p>here is my code</p>

<pre><code>    $(document).ready(function () {
        var name = getQueryParam("id")
         { var pairs = location.search.substring(1).split('&amp;'); for (var i = 0; i &lt; pairs.length; i++) 
         { var params = pairs[i].split('='); if (params[0] == param) { return params[1] || ''; } } return undefined; }; })(jQuery);

        if ( name == 1){
        scrollTo(0, 800);
        }
    });
</code></pre>
