标签:
var
obj = parseQueryString(url);
function
parseQueryString(argu){
var
str = argu.split(
‘?‘
)[1];
var
result = {};
var
temp = str.split(
‘&‘
);
for
(
var
i=0; i<temp.length; i++)
{
var
temp2 = temp[i].split(
‘=‘
);
result[temp2[0]] = temp2[1];
}
return
result;
}
编写一个参数JavaScript函数parseQueryString,它的用途是把url参数解析为一个对象
标签:
原文地址:http://www.cnblogs.com/luckyXcc/p/5889288.html