在coffeescript中获取“SyntaxError:[stdin]:27:45:无法比拟的OUTDENT”

时间:2016-07-01 20:51:28

标签: ruby-on-rails-4 if-statement coffeescript formatting

我正在使用Rails 4.2.3。我正试图在我的咖啡脚本中定义这个功能

toggle_auto_checkbox -> ()
  if $.trim($('#hometown').val().length > 0 and 
  ($.trim($('#first_name').val().length > 0 or $.trim($('#last_name').val().length > 0) and 
  $('#mySelectBox1 option').filter(':selected').text().length > 0 and   
  $('#mySelectBox2 option').filter(':selected').text().length > 0 and    
  $('#mySelectBox3 option').filter(':selected').text().length > 0 and   
  $('#mySelectBox4 option').filter(':selected').text().length > 0
    $("input.group1").removeAttr("disabled")
  else
    $("input.group1").attr("disabled", true)

但是当我尝试加载包含这个咖啡脚本的页面时,它会导致错误“SyntaxError:[stdin]:27:45:无法匹配的OUTDENT”。上面的问题是什么?

0 个答案:

没有答案
相关问题