Skip to content

Instantly share code, notes, and snippets.

@keyle
Forked from tsi/microTplEngine.js
Created February 6, 2014 03:35
Show Gist options
  • Save keyle/8838032 to your computer and use it in GitHub Desktop.
Save keyle/8838032 to your computer and use it in GitHub Desktop.
(function($) {
// My micro jQuery templating engine
// Usage:
//
// <section data-html="content"></section>
//
// Will load <content.html> into <section>
$(document).ready(function() {
// Load external contents
$("[data-html]").each(function() {
el = $(this);
var src = $(this).attr("data-html") + ".html";
el.load(src);
});
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment