JSFiddle - React, Tailwind, and code Playground

by Eric Howe

HTML

<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script id="with" type="text/x-underscore">
    <p><%= pancakes %></p>
</script>
<script id="no-with" type="text/x-underscore">
    <p><%= data.pancakes %></p>
</script>

JavaScript

var t_with = _.template($('#with').html());
console.log(t_with.source);
$('body').append(t_with({ pancakes: 'with' }));

var t_no_with = _.template($('#no-with').html(), null, { variable: 'data' });
console.log(t_no_with.source);
$('body').append(t_no_with({ pancakes: 'no-with' }));