In Microsoft Tmpl, you can inject a string template like this (from jQuery man pages):
jQuery.tmpl( template [, data][, options]);
$.tmpl( "<li>${Name}</li>", { "Name" : "John Doe" }).appendTo( "#target" );
And you could get the template from the server with a simple jQuery.get() without involving the DOM.
Now I know there are projects out there like Knockout.js-External-Template-Engine, but is there a way to pass Knockout a Javascript method (or string) representing the template without placing the template in the DOM (especially if you’re using an external template engine?) Something like data-bind="template: {name:mymethod}"
RP Niemeyer covers this in one of his blog posts
And here is his fiddle example.