Skip to content

Instantly share code, notes, and snippets.

@trey
trey / external_files_jquery_templates.md
Created May 18, 2012 03:08
Using External Files as jQuery Templates

Using External Files as jQuery Templates

Previously…

If you want to keep your templates in external files, you can load the template in like so:

$.get('/js/templates/filename.html', function(template) {
	$.tmpl(template, data).appendTo('#whatever');
});