rails, getting syntax error with coffee script

前端 未结 2 1908
终归单人心
终归单人心 2021-02-15 14:29

i am trying to do an autocomplete feature in rails using the jquery ui library. however i keep getting syntax errors \"Syntax Error: reserved word \"function\" on line ...\"

2条回答
  •  自闭症患者
    2021-02-15 15:21

    Only the first line is coffeescript; the rest is normal javascript.

    Try using this converter:

    http://js2coffee.org/

    $(function() {}); becomes $ ->

提交回复
热议问题