blueimp/JavaScript-Templates

Using templates inside javascript

andyscott12 opened this issue · 1 comments

Hey,

I was wondering how you would go about using the templates inside javascript ? That is - when you don't have access to the

<script type="text/x-tmpl" id="tmpl-demo">

Basically, the templates rock - but I want to use them within a javascript file ? Is that possible ?

Sure, as it is explained in the API documentation, the tmpl function can be used with a document ID or with a template string as first argument.

You could also use precompiled templates as explained here:
https://github.com/blueimp/JavaScript-Templates#compiled-templates