Ajax redirects

How to redirect the user without causing a page reload

Hyperlink based redirects

What about having a hyperlink element that redirects the user to a controller's action ajaxically?

  <a href="controller/action" ajaxify>Redirect</a>

Thats all! The hyperlink element will be ajaxified.

You can also ajaxify any other HTML element rather than hyperlinks. The trick is to always have the href and ajaxify attributes in place.

Code based redirects

Maybe you want to redirect the user from javascript code:


Browser back button

What happens when the user presses the back button on the browser?
Chill out, we got it under control. The user will be ajaxically redirected to the previous page.

Github Repository