js 如何获取地址栏参数
// ?name=zhangsan&age=11 => {name: "zhangsan", age: 11}
q={};
location.search.replace(/([^?&=]+)=([^&]+)/g,(_,k,v)=>q[k]=v);
// ?name=zhangsan&age=11 => {name: "zhangsan", age: 11}
q={};
location.search.replace(/([^?&=]+)=([^&]+)/g,(_,k,v)=>q[k]=v);