基本信息详情:
1 2 3 4 5 6 7 8 9 10 |
let params = new URLSearchParams(); // 通过 append() 方法添加所有的选项值 params.append('a', 'bmw'); params.append('b', 'audi'); params.append('c', 'mercedes'); const searchString = params.toString(); // 解析也同样简单 params = new URLSearchParams(`https://www.baidu.com/s?wd=URLSearchParams&rsv_spt=1&rsv_iqid=0xae7520f1000047de&issp=1&f=8&rsv_bp=1&rsv_idx=2&ie=utf-8&rqlang=cn&tn=baiduhome_pg&rsv_dl=tb&rsv_enter=1&oq=js%2520Bridge&rsv_btype=t&inputT=875&rsv_t=ce168%2FX7pGBcSOLm1iiww8GNa1okeBnWIYYnZWP%2Fo6d8XCXDT04t%2BDIxWRwBzmWJBtCa&rsv_pq=ae07b38e0000485c&rsv_sug3=6&rsv_sug1=5&rsv_sug7=100&rsv_sug2=0&prefixsug=URLSearchParams&rsp=0&rsv_sug4=875`); console.log(params.get('rsv_enter')); |