Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript remove get parameter from url

let url = new URL('https://example.com?foo=1&bar=2&foo=3');
let params = new URLSearchParams(url.search);

// Delete the foo parameter.
params.delete('foo'); //Query string is now: 'bar=2'
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #remove #parameter #url
ADD COMMENT
Topic
Name
4+4 =