I don’t manage to get past a simple parser error for quite some time now. I found several code sample on the web and those seem to be similar – I would deeply appreciate a hint!
$ ->
$(".category_modal").click (e) ->
alert "Hi"
e.preventDefault()
$.ajax
url: 'entries/detail'
type: "GET" <-- Error: Parse error on line 28: Unexpected '{'
dataType: 'json'
success: (data) ->
alert "Hi again"
$(".category_modal").html(data)
Depending on the IDE you use, I have found out that oftentimes I get errors compiling Coffescript files due to malformed spaces.
Solution: Select all the spaces before ‘type:’ AND the ones on the end of the previous line, ie after: ‘tries/detail’
Delete them, and form them again and try again to compile. This happens especially when I copy-paste from other sources