DailyJS

jquery.smoothstate.js, underscore-tpl

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

libraries animation jquery ui

jquery.smoothstate.js, underscore-tpl

Posted by Alex R. Young on .
Featured

libraries animation jquery ui

jquery.smoothstate.js, underscore-tpl

Posted by Alex R. Young on .

jquery.smoothState.js

jquery.smoothState.js (GitHub: weblinc / jquery.smoothState.js, License: MIT) by Miguel Angel Perez promises to improve the early page loading experience by reducing the amount of sudden visual cuts.

By using unobtrusive JavaScript, jquery.smoothState.js loads content asynchronously and updates the URL with history.pushState. Animations are used as a visual cue to indicate when the main page content has been replaced.

The project's documentation uses these techniques, but take a look at the demo for a more basic example to get started.

underscore-tpl

underscore-tpl (GitHub: creynders / underscore-tpl, License: MIT) by Camille Reynders allows you to expand placeholders stored within objects:

var config = {  
  baz: '<%= qux.mofo %>',
  major: {
    badass: '<%= badass %>'
  },
  '<%= foo %>': 'bar'

It can use mustache-style tags instead of ERB, and accepts the same options as _.templateSettings.

I've found myself using this type of thing for generating seed data or fixtures in tests, but I imagine it might also be useful if you're passing plain objects around with data-binding libraries as well.