I’m using this coffeescript to javascript converter http://coffeescript.org/ to work through a coffeescript tutorial (to improve both my coffeescript and jquery). However, when I try to do it with the following coffeescript, which was originally found in an jst.eco template file, it doesn’t work, even if I remove the <% %> Similarily, I tried to run the code on a live site and find out the compiled javascript using Firebug but the only file it showed me was the jquery file.
<% for entry in @entries.models: %>
<li><%= entry.get('name') %></li>
<% end %>
How would you write this in jquery?
That is not just Coffeescript, that is an eco template, i.e. an HTML template with embedded coffeescript code, similar to, say, JSP or PHP. It does something similar to
You may want to look at using an equivalent templating engine. jQuery itself apparently has one in beta-testing.