1
I’m using a function to clear the URL, but I’d just like to clear a part of it.
window.setTimeout(function() {
window.history.replaceState(null, null, window.location.pathname);
}, 5000);
For example the URL is ?id=1&msg=sc
and I wanted to just leave ?id=1
how can I do this?
What are you doing this for? Wouldn’t it be better to just take directly the values of
id
andmsg
without having to do separations and replacements?– Augusto Vasques