How to remove URL parameter to in JavaScript

1 Answer

0 votes
const URL = new URLSearchParams("http://seek4info.com/search.php?q=hosting&total=10&size=25k");
  
console.log(URL.toString());

URL.delete('total');

console.log(URL.toString());
  
  
    
      
/*
run:
      
"http%3A%2F%2Fseek4info.com%2Fsearch.php%3Fq=hosting&total=10&size=25k"
"http%3A%2F%2Fseek4info.com%2Fsearch.php%3Fq=hosting&size=25k"
      
*/

 



answered Jan 31, 2021 by avibootz

Related questions

...