TurboLinks Vs Pjax

jQuery Pjax

TurboLinks

 

Usability

  • TurboLinks
    by default it gets triggered by any anchor tag, so to ignore it for a certain link you will have to add data-turbolinks=”false” to that anchor.

  • Pjax
    you have to specify on which element you want it to be triggered & you can even specify more than one trigger for more than one container,
    ofcourse you can make pjax handle all links “same as TurboLinks” and dump the page content into the “body” but you will be missing the main reason why you would be using it over TurboLinks


Content Replacement

  • TurboLinks
    will replace the whole body content, so something like a soundcloud player in the footer wont persist playing between pages.

  • Pjax
    in order for anything to be loaded into the main page (incase of using a templating system) from the visited link, it have to be inside the container.


Template Structuring

  • TurboLinks
    you structure your code as normal using things like “@include, @stack, etc..” and it will be added exactly where you want it (even inside the header tag).

  • Pjax
    with something like “@stack” unless its inside the container, it wont work, which creates a muddy code and wrong html render.


Issues

- in both, you can inline any js code inside your template and it will be executed as usual
“as long as any required js library your code may need has already been loaded on the page visit”.

Also Check

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s