js change url
snippet in javascript

js change url

user9121

 window.location.href = "www.google.com"; 

javascript change url without reload

user391

window.history.pushState('', 'New Page Title', '/new-url.php');

javascript change url

user5044

history.pushState({}, null, newUrl);

change url without reloading

user4123

 function processAjaxData(response, urlPath){
     document.getElementById("content").innerHTML = response.html;
     document.title = response.pageTitle;
     window.history.pushState({"html":response.html,"pageTitle":response.pageTitle},"", urlPath);
 }