2 ms·
The gist of it is this. If you include the minified version of the CoffeeScript compiler on a webpage (43k, gzipped), it will compile and evaluate the inline co
by jashkenas 17y ago
The gist of it is this. If you include the minified version of the CoffeeScript compiler on a webpage (43k, gzipped), it will compile and evaluate the inline coffeescripts on the page. That documentation site uses it to hook up the menu and the "Try CoffeeScript" demonstration in the toolbar.
If you view source, you'll see something along these lines:
<script type="text/coffeescript">
window.repl_run: ->
try
eval window.compiled_js
catch error then alert error
close_menus: ->
current_nav.removeClass 'active' if current_nav
current_nav: null
$(document.body).click -> close_menus()
</script>