RoR和咖啡脚本:出乎意料(



我看不出我的代码有什么问题。这似乎是一个奇怪的错误。查看此处查看"try coffeescript"编译器中的代码。

jQuery ->
  $('#swipes').sortable
    axis: 'y'
    update: ->
      $.post( $(this).data('update-url'), $(this).sortable.('serialize') )

错误读取:

Error on line 5: unexpected (

你的错误是语法错误,因为在第5行你写的是

$(this).sortable.('serialize')

但是那里有一个额外的.导致错误。尝试;

$(this).sortable('serialize')

由于额外的.,编译器无法识别该函数。

希望有帮助!

最新更新