1
2
3
4
5
6
7
8
9
10 |
function (name) { var
query=location.search.substring(1); var
pairs=query.split( "&" ); for ( var
i=0;i<pairs.length;i++) { var
pos=pairs[i].indexOf( ‘=‘ ); if (pos==-1) continue ; if (name==pairs[i].substring(0,pos)) {value=pairs[i].substring(pos+1); return
value;} } return
undefined; } |
[snippet] get parameter,布布扣,bubuko.com
原文:http://www.cnblogs.com/ipup/p/3731825.html