-
-
Save jdsharp/613705 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
// Example of how to cache the result of an external jQuery Template. | |
// Inspired by this post... | |
// http://encosia.com/2010/10/05/using-external-templates-with-jquery-templates/ | |
var person = {name: 'Dave'}; | |
var person_tmpl; | |
$.get('_template.tpl.html', function(template) { | |
// Use converted string from remote file. | |
person_tmpl = $.tmpl(template, person); | |
person_tmpl.appendTo('body'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment