window.history.pushState('', 'New Page Title', '/new-url.php');
window.history.replaceState({}, '','/dashboard');
// I want to change google.com in google.com/test.html in the address bar without reload
window.history.replaceState(null, '', '/test.html');
/*
replaceState(stateObj, unused)
replaceState(stateObj, unused, url)
stateObj :
The state object is a JavaScript object which is associated with
the history entry passed to the replaceState method. The state object can be null.
unused :
This parameter exists for historical reasons, and cannot be
omitted; passing the empty string is traditional, and safe against future
changes to the method.
url (Optional) :
The URL of the history entry. The new URL must be of the same origin as
the current URL; otherwise replaceState throws an exception.
*/
history.pushState(state, title, url)
window.history.pushState('page2', 'Title', '/page2.php');
function processAjaxData(response, urlPath){
document.getElementById("content").innerHTML = response.html;
document.title = response.pageTitle;
window.history.pushState({"html":response.html,"pageTitle":response.pageTitle},"", urlPath);
}