例如href="www.test.com/test.html?teststr=dddsdss"
我想得到dddsdss,怎么做?alert()出它
------解决方案--------------------
- JScript code
function parse_str(url) { var qs = url.split('?').pop().split('&'); var qso = {} for(var i=0;i<qs.length;i++){ if(qs[i]=="") continue; var tmpa = qs[i].split("="); qso[tmpa[0]] = tmpa[1]?tmpa[1]:""; } return qso; } param = parse_str('www.test.com/test.html?teststr1=dddsdss&teststr2=ffsss');