user847495 user847495 - 6 months ago 12
HTML Question

In Javascript, how do I reload the page without the query parameters?

Let's say I want to reload

www.domain.com/abc?num=4


But I want to reload
www.domain.com/abc
ONLY (without everything after the question mark)

Answer
window.location = window.location.href.split("?")[0];