const slipUrl=(url)=>{
const a=url.split('?');
const b=a[1];
const c=b.split('&');
const obj={};
for( let i=0;i<c.length;i++){
const arrSingle=c[i].split('=');
obj[arrSingle[0]]=arrSingle[1];
}
return obj
}
const url='http://www.runoob.com/jquery/misc-trim.html?channelid=12333&name=xiaoming&age=23';
slipUrl(url);
网友评论