Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #change #query #string #parameter
ADD COMMENT
Topic
Name
2+4 =