js change url

JavaScript
 window.location.href = "www.google.com"; window.history.pushState('', 'New Page Title', '/new-url.php');history.pushState({}, null, newUrl); function processAjaxData(response, urlPath){
     document.getElementById("content").innerHTML = response.html;
     document.title = response.pageTitle;
     window.history.pushState({"html":response.html,"pageTitle":response.pageTitle},"", urlPath);
 }
Source

Also in JavaScript: