Answers for "jquery change query string parameter value"

0

jquery change query string parameter value

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);
Posted by: Guest on July-22-2021

Code answers related to "jquery change query string parameter value"

Code answers related to "Javascript"

Browse Popular Code Answers by Language