📜  jquery 更改查询字符串参数值 - Javascript 代码示例

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

代码示例1
var currentUrl = 'http://www.example.com/hello.png?w=100&h=100&bg=white';
var url = new URL(currentUrl);
url.searchParams.set("w", "200"); // setting your param
var newUrl = url.href; 
console.log(newUrl);