jq-render

Simple Handlebars render plugin for jQuery

Usage no npm install needed!

<script type="module">
  import jqRender from 'https://cdn.skypack.dev/jq-render';
</script>

README

jQuery Render

Simple Handlebars render plugin for jQuery

Usage

First, initialize the template.

  $('#my-placeholder').render('Here is a {{Handlebar}} template');

Or with the content inside an element

<div id="my-placeholder">Hello {{name}}!</div>

And apply the plugin without parameters.

  $('#my-placeholder').render();

Then simply render the template with some data.

  $('#my-template').render({ name: 'World!' });

Also you can initialize the template and render at the same time.

  $('#my-template').render({ name: 'World' }, 'This is another hello {{name}}!');

Once initialized the template, the render can be run again with new data.

  $('#my-template').render({ name: 'Another World' });