Home > IHazFlat.js

IHazFlat.js

IHazFlat.js is a project mainly written in JavaScript, based on the View license.

Super lightweight client-side templating solution for Flatstache.js


| || Y |.---.-..-----.| || |.---.-.| | ||.-----. |. ||. 1 || _ ||-- _||. 1|| || || | | || --| |. ||. _ ||.||__||. ) |__||._||__|||| ||__| |: ||: | | |: | ||
|::.||::.|:. | |::.|
---'--- ---' `---'

INTRO:
If you want a super-duper-lightweight template solution to go along with Zepto.js (works with jQuery too). This may be just what you're looking for.

If you're wanting full mustache.js with partials and conditionals you probably want ICanHaz.js (http://icanhazjs.com).

THE QUICK DEMO:

  1. Include IHazFlat.min.js and either jQuery or Zepto.js in your page.

  2. Define your template by adding a

  3. Retrieve populated template var user = ihf.user(user_data_object)

WHAT IS IHAZFLAT? IHazFlat is a client-side templating helper for working with Flatstache.js templates in the browser.

WHAT IS FLATSTACHE? A super-lightweight version of Mustache that removes support for partials and conditionals in the name of simplicity and tiny filesize. Flatstache was written by code wizard @natevw and is also on github at https://github.com/natevw/flatstache.js.

IHazFlat.js is MIT Licensed and includes @natevw's awesometastic flatstache.js for convenience. Also, high five to Chris Wanstrath for inventing Mustache (and founding github.com).

BROWSER SUPPORT Tested in IE6+ and modern browsers (obviously it won't work with zepto in browser zepto doesn't support).

TESTS? Yes.