Coffeescript is now compiling the following code
$ ->
$("#debug").val "hey"
for i in [0..3]
m = new Message(5,5)
text = "<div>#{m.message[m.message_id]}</div>"
$("body").append(text)
into:
$(function() {
return $("#debug").val("hey");
});
for (i = 0; i <= 3; i++) {
m = new Message(5, 5);
text = "<div>" + m.message[t.message_id] + "</div>";
$("body").append(text);
}
The whole “for” clause is totally outside the jQuery load function. What is going on here? What’s wrong with my way of indenting??
Here’s a wild guess: you’re mixing tabs and spaces for indentation. If your CoffeeScript is this (where, of course
<tab>is a single tab character):then you’ll get the output you’re seeing and if your tab-stop is set to 4, your eyes won’t notice.