地址栏参数可能进行转码
function parseQueryString(url, money, hash) {
// 解析url返回JSON对象
hash = hash ? hash : "&";
money = money ? money : "?";
var text = "";
var data = {};
if (url.indexOf(money) != -1) {
text = url.substr(url.indexOf(money) + 1, url.length);
if (url.indexOf(hash) != -1) {
text = text.split(hash);
text.forEach(function (item) {
var d = item.split("=");
data[d[0]] = d[1];
});
} else {
text = text.split("=");
data[text[0]] = text[1];
}
return data;
} else {
return {};
}
}