JavaScript is very extensive. While working with client side, you may occasionally want to redirect client after Ajax request success, e.g., redirect to dashboard after login successful. If you want to redirect to another page you have two options.
location.href
If you want to simulate like someone clicking on a link, use location.href
// same as user clicking on a link
window.location.href = "https://laravelcode.com";
location.replace
If you want to simulate an HTTP redirect, use location.replace
// same as an http redirect
window.location.replace("https://laravelcode.com");
JQuery $(location)
You can also redirect using JQuery library.
$(location).attr('href', 'https://laravelcode.com');
I hope it will help you.