window.location.href = "www.google.com";
var url = window.location.origin + '/foo/foo.php';
history.pushState({}, null, url);
history.pushState({}, null, newUrl);
element.setAttribute('href','http://www.google.com');
$(document).ready(function(){
window.history.pushState('page2', 'Title', '/');
});