jonnyreeves/jquery-Mustache — pull request #31 by yingxinj (2013-12-20 10:57:29+00:00)
Title: Adds method to load and render a template into an element in one step

I prefer to have one template per file. In this case, it's annoying to have to load the template first, and then render it. This method allows you to do both in one step, i.e.:

$("#template-placeholder").load("template.html", viewData);

The default method is .html() because I think in cases where you would use .append(), you'd probably be rendering the same template multiple times in which case this new .load() method isn't as useful. I realise this could be confusing for users so am happy to change it back to .append() if you prefer!

I'd like to add a demo / example for this as well, but the demo pages use src/jquery.mustache.js and I'm not sure if I should be editing that as well.