How to add or update query string parameter to current url in Javascript
In this post, I will let you know how to add or update query string parameter to current URL using Javascript. function updateQueryStringParameter(uri, key, value) { var re = new RegExp( "([?&])" + key + "=.*?(&|$)" , "i" ); var separator = uri.indexOf( '?' ) !== -1 ? "&" : "?" ; if (uri.match(re)) { return uri.replace(re, '$1' + key + "=" + value + '$2' ); } else { return uri + separator...