 <p>Am assuming you know javascript array and few method</p> <hr> <p>Use the <strong><em>window.location.href</em></strong></p> <p>var url = 'site.com/seach?a=val0&amp;b=val1'</p> <p>split the '?' </p> <p>var someArray = url.split('?');</p> <p>The someArray looks like this ['site.com/seach', 'a=1000&amp;b=c'] index 0 is the window.location and index 1 is queryString</p> <p>var queryString = someArray[1];</p> <p>Go futher a split '&amp;' so u get a key=value</p> <p>var keyValue = queryString.split('&amp;');</p> <p>keyVal looks like this ['a=val0', 'b=val1'];</p> <p>Now lets get keys and values.</p> <p>var keyArray=[], valArray=[];</p> <p>Loop through the keyValue array and split '=' the update keyArray and valArray</p> <p>for(var i = 0; i &lt; keyValue.length; i++){</p> <p>key = keyValue[i].split('=')[0];</p> <p>val = keyValue[i].split('=')[1];</p> <p>keyArray.push(key);</p> <p>valArray.push(val);</p> <p>}</p> <p>Finally we have</p> <p>keyArray = ['a', 'b'];</p> <p>valArray = ['val0', 'val1'];</p> <p>Our full codes looks like this.</p> <p>var url = 'site.com/seach?a=val0&amp;b=val1';</p> <p>var someArray = url.split('?');</p> <p>var queryString = someArray[1];</p> <p>var keyValue = queryString.split('&amp;');</p> <p>var keyArray=[], valArray=[];</p> <p>for(var i = 0; i &lt; keyValue.length; i++){</p> <p>key = keyValue[i].split('=')[0];</p> <p>val = keyValue[i].split('=')[1];</p> <p>keyArray.push(key);</p> <p>valArray.push(val);</p> <p>}</p> <p>DONE!</p>