JSFiddle - React, Tailwind, and code Playground

by Eric Howe

HTML

<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<div id="view-goes-here"></div>
<script id="tmpl" type="text/template">
    {{ if(loggedIn) { }}Welcome {{= name }} {{ } }}
</script>

CSS

#view-goes-here {
    padding: 50px;
    border: 1px solid black;
}

JavaScript

_.templateSettings = {
    evaluate:    /\{\{(.+?)\}\}/g,
    interpolate: /\{\{=(.+?)\}\}/g
};
$('#view-goes-here').html(
    _.template($('#tmpl').html(), {
        loggedIn: true,
        name: 'James'
    })
);