You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 28, 2018. It is now read-only.
Turbolinks makes following links in your web application faster. Instead of letting the browser reload the JavaScript and CSS between each page change, and spend extra HTTP requests checking if the assets are up-to-date, we keep the current instance alive and replace only the body and the title in the head.
5
+
6
+
This is similar to pjax, but instead of worrying about what element on the page to replace, and tailoring the server-side response to fit, we replace the entire body. This means that you get the bulk of the speed benefits from pjax (no recompiling of the JavaScript or CSS) without having to tailor the server-side response. It just works.
7
+
8
+
By default, all internal links will be funneled through Turbolinks, but you can opt out by marking links with data-no-turbolink.
9
+
10
+
11
+
No jQuery or any other framework
12
+
--------------------------------
13
+
14
+
Turbolinks is designed to be as light-weight as possible (so you won't think twice about using it even for mobile stuff). It does not require jQuery or any other framework to work. But it works great _with_ jQuery or Prototype or whatever else have you.
15
+
16
+
17
+
The page:update event
18
+
---------------------
19
+
20
+
Since pages will change without a full reload with Turbolinks, you can't by default rely on dom:loaded to trigger your JavaScript code. Instead, Turbolinks uses the page:update event. If you have existing JavaScript code that's made for dom:loaded, you can connect the two using:
You can use `Turbolinks.visit(path)` to go to a URL through Turbolinks.
31
+
32
+
33
+
Available only for pushState browsers
34
+
-------------------------------------
35
+
36
+
Like pjax, this naturally only works with browsers capable of pushState. But of course we fall back gracefully to full page reloads for browsers that do not support it.
0 commit comments