Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to delete a parameter with js

// Remove all Parameters
var url = new URL('http://demourl.com/path?topic=main');
// set search property to blank
url.search = '';
var new_url = url.toString();
// output : http://demourl.com/path
console.log(new_url);
 
PREVIOUS NEXT
Tagged: #delete #parameter #js
ADD COMMENT
Topic
Name
3+9 =