Answers for "js push params to url"

-1

js push params to url

function setQueryStringParameter(name, value) {
    const params = new URLSearchParams(window.location.search);
    params.set(name, value);
    window.history.replaceState({}, "", decodeURIComponent(`${window.location.pathname}?${params}`));
}
Posted by: Guest on March-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language