I\'ve been looking for an efficient way to do this but haven\'t been able to find it, basically what I need is that given this url for example:
http://localh
Nowdays that's possible with native JS
var href = new URL('https://google.com?q=cats'); href.searchParams.set('q', 'dogs'); console.log(href.toString()); // https://google.com/?q=dogs