Wednesday 15 January 2014

javascript - Uncaught ReferenceError in jquery code compiled from coffeescript -



javascript - Uncaught ReferenceError in jquery code compiled from coffeescript -

i have next jquery code (compiled coffee script).

(function() { $(function() { homecoming $.get('/proteins', function(proteins) {}); }); $.each(proteins, function(index, protein) { homecoming $('#proteins').append($("<li>").text(protein.name)); }); }).call(this);

the coffeescript generated code looks this:

$ -> $.get '/proteins', (proteins) -> $.each proteins, (index, protein) -> $('#proteins').append $("<li>").text protein.name

i maintain getting "uncaught referenceerror: proteins not defined" @ line 6 of generated code.

am missing (very basic) here?

thanks!!

there tab indenting $.each , spaces elsewhere. indentation not correct. utilize editor coffeescript support.

javascript jquery coffeescript referenceerror

No comments:

Post a Comment