ExecJS::ProgramError: SyntaxError: Reserved word “function”

前端 未结 3 1586
醉酒成梦
醉酒成梦 2021-01-07 16:49

In our rails rfq.js.coffee, we only have a simple js code:

$(function() {
  $(\'#need_report\').change(function(){
    if ($(this).val() == true) {
      $(\         


        
3条回答
  •  轮回少年
    2021-01-07 17:12

    You can embed regular javascript by surrounding the code with back-ticks "`". I wish it worked like the other parsing languages as well...it took me lot's of unnecessary debugging and searching to figure that out. http://coffeescript.org/#embedded

提交回复
热议问题