传入的参数为:var obj = {"a":"1","b":"2"};
实现方法:
getparam(obj);
function getparam(obj){
var arr = Object.keys(obj);
var str = "?";
for(var i in obj){
str += i;
str += "=";
str += obj[i];
str += "&";
}
str = str.substr(0,str.length-1);
return str;
}