Reputation: 2032
I'm now redirecting to main page in my Rails application using
redirect_to root_path
I want to do the same in jQuery.
i.e. window.location.replace("???");
How to do that?
Upvotes: 5
Views: 9366
Reputation: 305
window.location = '/'
Disadvantage in using window.location.replace('/')
is user won't be able to press "Back" and go back to the previous page.
Upvotes: 16