 <p><strong>Edit</strong></p> <p>I just found this jQuery plugin - <a href="http://markdalgleish.com/projects/tmpload/" rel="nofollow">http://markdalgleish.com/projects/tmpload/</a> Does exactly what you want, and can be coupled with <code>$.tmpl</code></p> <hr> <p>I have built a lightweight template manager that loads templates via Ajax, which allows you to separate the templates into more manageable modules. It also performs simple, in-memory caching to prevent unnecessary HTTP requests. (I have used jQuery.ajax here for brevity)</p> <pre><code>var TEMPLATES = {}; var Template = { load: function(url, fn) { if(!TEMPLATES.hasOwnProperty(url)) { $.ajax({ url: url, success: function(data) { TEMPLATES[url] = data; fn(data); } }); } else { fn(TEMPLATES[url]); } }, render: function(tmpl, context) { // Apply context to template string here // using library such as underscore.js or mustache.js } }; </code></pre> <p>You would then use this code as follows, handling the template data via callback:</p> <pre><code>Template.load('/path/to/template/file', function(tmpl) { var output = Template.render(tmpl, { 'myVar': 'some value' }); }); </code></pre>