I have string which is in url like below
?type=english&time=today
I want to get the values of type and time and curently doing like below
var str="?type=english&time=today";
var spt =str.split("&");
var typeval =spt[0].split("=")[1];
var timeval =spt[1].split("=")[1];
document.write(" type :"+typeval+" time : "+timeval);
What is the efficient way to get the values using javascript.