best way to split a string and get url values using javascript
<p>I have string which is in url like below</p>

<pre><code>?type=english&amp;time=today
</code></pre>

<p>I want to get the values of type and time and curently doing like below</p>

<pre><code>var str="?type=english&amp;time=today";

var spt =str.split("&amp;");
var typeval =spt[0].split("=")[1];
var timeval =spt[1].split("=")[1];

document.write(" type :"+typeval+" time : "+timeval);
</code></pre>

<p>What is the efficient way to get the values using javascript.</p>
