Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect to root page in jQuery?

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?

like image 568
sgi Avatar asked Dec 08 '22 04:12

sgi


1 Answers

window.location = '/'

Disadvantage in using window.location.replace('/') is user won't be able to press "Back" and go back to the previous page.

like image 197
user144390 Avatar answered Dec 22 '22 06:12

user144390