update param in url jquery
var url = new URL('http://demourl.com/path?id=100');
var search_params = url.searchParams;
// add "topic" parameter
search_params.set('topic', 'main');
url.search = search_params.toString();
var new_url = url.toString();
// output : http://demourl.com/path?id=100&topic=main
console.log(new_url);
Also in JavaScript:
- how to get the selected index of dropdown in jquery
- javascript make new date from hour
- How can I refresh a page with jQuery
- radio unchecked
- javascript regex match character from a set of characters
- firestore set a document
- ternary operator
- how can we take selected index value of dropdown in javascript
- javascript array to csv string
- javascript replace content of div
- how to refresh a web page automatically in javascript
- randint js
- node check if file exists
- download image in nodejs
- javascript random sort array
- javascript replace ios apostrophe
- javascript reduce method stack overflow
- get contents between tags javascript
- implicit type conversion js
- javascript break out of loop
- npm ERR! Unexpected end of JSON input while parsing near '...ty":"sha512-2GTXt3b2Q'
- how to check if function is running js
- launch uikit modal from php
- mapstatetoprops redux