javascript change url without redirect code example
Example 1: javascript change url without redirect
window.history.pushState("", "", '/newpage');
Example 2: javascript redirect
window.location.href = "http://mywebsite.com/home.html";
window.history.pushState("", "", '/newpage');
window.location.href = "http://mywebsite.com/home.html";