📜  javascript urlsearchparams 到字符串 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:50.333000             🧑  作者: Mango

代码示例1
let params = new URLSearchParams('foo=2'); // "location.search" to read from URL

params.append('bar', 4);                   //Add a bar parameter.
console.log(params.toString());            //Prints 'foo=2&bar=4'

location.search = params.toString();       // write changes to URL