// full urlwindow.location.href = "https://www.google.com"// relative urlwindow.location.href = "/about"// this works as wellwindow.location = "https://www.google.com"
If you are using jQuery
$(location).attr('href', url);
Alternatively you can also use
// replace current history, not possible to go backwindow.location.replace(url);// keep history, can click backwindow.location.assign(url);