Upgrade to Pro — share decks privately, control downloads, hide ads and more …

pjax & jianshu.pdf

larryzhao
October 23, 2012

pjax & jianshu.pdf

larryzhao

October 23, 2012
Tweet

More Decks by larryzhao

Other Decks in Technology

Transcript

  1. What is pjax pjax = html5 push-state + Ajax pjax

    library to make life better: https://github.com/defunkt/jquery-pjax since Feb.26 2011 https://github.com/welefen/pjax since Jul.21 2011 Tuesday, October 23, 12
  2. Why pjax? Our web in old times We can.. ✓

    request and response, waiting for the next page to show. We can’t... ✘ update the page partialy ✘ operate on the page meanwhile it communicates with the server. Tuesday, October 23, 12
  3. Why pjax? ajax is invented We can.. ✓ update only

    a part of the page We can’t... ✘ no browser history ( can’t go back and forward) ✘ cannot share what you see to others with the link ✘ search engine crawlers can’t trigger ajax, don’t know your content ✘ json serialization Tuesday, October 23, 12
  4. Why pjax? finally pjax We can... ✓ update partially on

    page with original HTML response, don’t need to support another data type. ✓ browser history preserved ( enabled by HTML5 pushState ✓ Search Engine friendly. ✓ no json serialization/deserialization and heavy DOM manipulation on the client. Tuesday, October 23, 12
  5. What do I feel? Easy to implement, and it works

    quite good as DHH proposed. And you could write more ruby less javascript. It’s a little bit annoy dealing with the initialization code, because you need to call them again at pjax:success Tuesday, October 23, 12