var Loc = location.search.substr(1); Loc = Loc.split('&'); for(i=0;i<Loc.length;i++) { Loc[i] = Loc[i].split('='); alert(Loc[i][0]+','+Loc[i][1]); }