var url = "http://www.baidu.com?a=1&b=2&c=3"
function fn(str) {
let obj ={}
let str1 = str.split('?')
let str2 = str1[1].split('&')
for(let i = 0; i < str2.length; i++){
let str3 = str2[i].split("=")
obj[str3[0]] = str3[1]
}
return obj
}
console.log( fn(url))