newUrl = window.location.href + ‘?/toggle=enprimeur’;window.history.pushState({ path: newUrl }, ”, newUrl); This code replaces the last segment of the current URL with the string ‘retail’ and updates the browser’s history state with the new URL. Thus it will not cause any issues in the current working. Otherwise we will get “page not found” error after adding… Continue reading How to add a new parameter to the URL without affecting the current working