$.ajax '/',
type: 'GET'
dataType: 'html' error: (jqXHR, textStatus, errorThrown) ->
$('body').append "AJAX Error: #{textStatus}"
success: (data, textStatus, jqXHR) ->
$('body').append "Successful AJAX call: #{data}"
there is something wrong with the above code,I can’t compile it into js
The compiler gives the error
referring to the line
The problem is simply that there’s no comma (or line break) between
'html'anderror. Here’s the fixed code:I highly recommend using an editor with a built-in “Build” command, especially one that can work on selected text. It makes syntax errors a lot easier to pin down.