use window.location.href without redirect code example Example: javascript change url without redirect window.history.pushState("", "", '/newpage');