首页 > 移动平台 > 详细

May we can use Turbolinks or Pjax in our web apps

时间:2014-07-17 13:06:02      阅读:453      评论:0      收藏:0      [点我收藏+]

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

May we can use Turbolinks or Pjax in our web apps,布布扣,bubuko.com

May we can use Turbolinks or Pjax in our web apps

原文:http://www.cnblogs.com/LiuXianBlog/p/3850430.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!