-
-
Save keyle/8838032 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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