JSFiddle - React, Tailwind, and code Playground

by Vladimir Sobolev

HTML

<script src="https://raw.githubusercontent.com/BorisMoore/jquery-tmpl/master/jquery.tmpl.min.js"></script>
<script id="tpl1" type="text/x-jquery-tmpl">
    ${comments}
</script>

<div id="test1"></div>
<div id="test2"></div>
<div id="test3"></div>

JavaScript

var data = {
			    title: 'Title',
			    comments: 123,
			    comments2: {
			        count: 456
			    }
			};
			
			var tpl2 = '${title} : {{tmpl tpl1}}';
			var tpl3 = '${title} : {{tmpl tpl5}}';
			var tpl4 = '${title} : {{tmpl(comments2) tpl6}}';

			var tpl5 = "${comments}";
			var tpl6 = "${count}";

			
			
			$('#test1').html($.tmpl(tpl2, data));
			$('#test2').html($.tmpl(tpl3, data));
			$('#test3').html($.tmpl(tpl4, data));