您的位置:首页 > 移动开发

May we can use Turbolinks or Pjax in our web apps

2014-07-17 10:40 274 查看
Turbolinks[1]:

Turbolinks makes following links in your web application faster.
Instead of letting the browser recompile the JavaScript and CSS between each page change,
it keeps the current page instance alive and replaces only the body and the title in the head.

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.

Pjax[2]:

pjax = pushState + ajax
pjax is a jQuery plugin that uses ajax and pushState to deliver a fast browsing experience with real permalinks,
page titles, and a working back button.

pjax
works by grabbing html from your server via ajax and replacing the
content of a container on your page with the ajax'd html.
It then updates the browser's current url using pushState without reloading your page's layout or any resources (js, css),
giving the appearance of a fast, full page load. But really it's just ajax and pushState.

[1] https://github.com/rails/turbolinks
[2] https://github.com/defunkt/jquery-pjax
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐