batman.js template
HTML
<script src="https://github.com/jashkenas/coffee-script/raw/master/extras/coffee-script.js"></script>
<script src="http://github.com/Shopify/batman/raw/master/lib/es5-shim.js"></script>
<script src="http://github.com/Shopify/batman/raw/master/lib/batman.js"></script>
<script src="http://github.com/Shopify/batman/raw/master/lib/batman.jquery.js"></script>
<link rel="stylesheet" href="http://batmanjs.org/examples/resources/reset.css">
<dl>
<dt data-foreach-key="hash" data-bind="key"></dt>
<dd data-foreach-key="hash" data-bind="hash[key]"></dd>
</dl>
<!-- This enables us to run coffeescript below. --->
<script>(function(){var s="script",n='\n',d=document,b=d.getElementsByTagName(s);b=b[b.length-2].innerHTML.split(n); d.write('<'+s+' type="text/coffeescript">'+b.slice(2,b.length-2).join(n)+'</'+s+'>');})()</script>
CSS
body {
background-color: #f0f0f0;
}
#container {
display: block;
width: 400px;
margin: 0 auto;
margin-top: 30px;
}
h2 {
clear: both;
}
JavaScript
# batman.js jsfiddle Template ©2011 CJ Lazell
class Hello extends Batman.App
Hello.hash = new Batman.Hash()
Hello.hash.set('foo', 'bar')
Hello.hash.set('bar', 'baz')
Hello.hash.set('dotted.key', 'value')
Hello.run()