JSFiddle - React, Tailwind, and code Playground
by TheSneak
HTML
<script src="https://raw.github.com/jquery/jquery-tmpl/master/jquery.tmpl.js"></script>
<div id="placeholder"></div>
<script id="tmpl" type="text/x-jquery-tmpl">
<input type="text" {{if $data.brother && brother.likesBlue}}value="this guy likes blue"{{/if}} />
</script>
CSS
div{
background-color: orange;
}
JavaScript
var stuff = {
brother: undefined
};
window.notNullNorUndefined = function(obj) {
var result = !! obj;
console.log(result);
return result;
};
try {
$("#tmpl").tmpl(stuff).appendTo("#placeholder");
} catch (ex) {
$("#placeholder").append("Error on line " + ex.lineNumber + ": " + ex.message);
}
console.log (typeof null);
console.log (typeof undefined);