• <tfoot id='N9nVp'></tfoot>

      <legend id='N9nVp'><style id='N9nVp'><dir id='N9nVp'><q id='N9nVp'></q></dir></style></legend>
    1. <i id='N9nVp'><tr id='N9nVp'><dt id='N9nVp'><q id='N9nVp'><span id='N9nVp'><b id='N9nVp'><form id='N9nVp'><ins id='N9nVp'></ins><ul id='N9nVp'></ul><sub id='N9nVp'></sub></form><legend id='N9nVp'></legend><bdo id='N9nVp'><pre id='N9nVp'><center id='N9nVp'></center></pre></bdo></b><th id='N9nVp'></th></span></q></dt></tr></i><div id='N9nVp'><tfoot id='N9nVp'></tfoot><dl id='N9nVp'><fieldset id='N9nVp'></fieldset></dl></div>

        <small id='N9nVp'></small><noframes id='N9nVp'>

          <bdo id='N9nVp'></bdo><ul id='N9nVp'></ul>

        CoffeeScript - 无与伦比的 OUTDENT

        CoffeeScript - Unmatched OUTDENT(CoffeeScript - 无与伦比的 OUTDENT)

        <small id='d31s0'></small><noframes id='d31s0'>

      1. <tfoot id='d31s0'></tfoot>
              <bdo id='d31s0'></bdo><ul id='d31s0'></ul>
                  <tbody id='d31s0'></tbody>
                <i id='d31s0'><tr id='d31s0'><dt id='d31s0'><q id='d31s0'><span id='d31s0'><b id='d31s0'><form id='d31s0'><ins id='d31s0'></ins><ul id='d31s0'></ul><sub id='d31s0'></sub></form><legend id='d31s0'></legend><bdo id='d31s0'><pre id='d31s0'><center id='d31s0'></center></pre></bdo></b><th id='d31s0'></th></span></q></dt></tr></i><div id='d31s0'><tfoot id='d31s0'></tfoot><dl id='d31s0'><fieldset id='d31s0'></fieldset></dl></div>

              • <legend id='d31s0'><style id='d31s0'><dir id='d31s0'><q id='d31s0'></q></dir></style></legend>

                  本文介绍了CoffeeScript - 无与伦比的 OUTDENT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我一直在尝试将我的工作 javascript 代码传递给 CoffeeScript,但我无法通过此错误:

                  I've been trying to pass my working javascript code into CoffeeScript but i can't get pass this error:

                  第 55 行不匹配的 OUTDENT

                  unmatched OUTDENT on line 55

                  这是咖啡脚本代码

                  $(document).on("click",".save_button", ->
                      $form = $(this).parent().parent().parent().parent().parent().parent()
                      $form.bind("ajax:complete", ->
                                  $actionURI = $form.attr("action");
                          $.get(window.location.protocol+"//"+window.location.host+$actionURI+".js",(data) ->
                                      $form.parent().parent().prev().html(data); //Line 55
                                      closeSaveElement()
                          ,"html")
                      );
                      $form.submit();   
                      return false;
                  );
                  

                  我已经尝试在任何地方放置和擦除 ; 但我没有什么问题.我也尝试将 -> 更改为 => 但弹出相同的错误.

                  i've tried putting and erasing ; everywhere but i don't whats wrong. I also tried to change -> for => but the same error pops up.

                  推荐答案

                  有效的 JS 并不是真正有效的 CoffeeScript.你必须这样做:

                  Valid JS isn't really valid CoffeeScript. You'd have to do something like this:

                  $(document).on "click", ".save_button", ->
                      $form = $(this).parent().parent().parent().parent().parent().parent()
                  
                      $form.bind "ajax:complete", ->
                          $actionURI = $form.attr "action"
                          $.ajax
                              type: "get"
                              url: "#{window.location.protocol}//#{window.location.host}#{$actionURI}.js"
                              dataType: "html"
                              success: ->
                                  $form.parent().parent().prev().html(data)
                                  closeSaveElement()
                  
                      $form.submit()
                  
                      return false
                  

                  另外,对这一行做点什么:

                  Also, do something about this line:

                  $form = $(this).parent().parent().parent().parent().parent().parent()
                  

                  .closest() 应该会有所帮助.

                  这篇关于CoffeeScript - 无与伦比的 OUTDENT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                  Rails 3.1 ajax:success handling(Rails 3.1 ajax:成功处理)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  Ordinals in words javascript(javascript中的序数)
                  getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)
                  <tfoot id='CQXYG'></tfoot>

                  • <small id='CQXYG'></small><noframes id='CQXYG'>

                        • <bdo id='CQXYG'></bdo><ul id='CQXYG'></ul>

                            <i id='CQXYG'><tr id='CQXYG'><dt id='CQXYG'><q id='CQXYG'><span id='CQXYG'><b id='CQXYG'><form id='CQXYG'><ins id='CQXYG'></ins><ul id='CQXYG'></ul><sub id='CQXYG'></sub></form><legend id='CQXYG'></legend><bdo id='CQXYG'><pre id='CQXYG'><center id='CQXYG'></center></pre></bdo></b><th id='CQXYG'></th></span></q></dt></tr></i><div id='CQXYG'><tfoot id='CQXYG'></tfoot><dl id='CQXYG'><fieldset id='CQXYG'></fieldset></dl></div>
                              <tbody id='CQXYG'></tbody>

                          1. <legend id='CQXYG'><style id='CQXYG'><dir id='CQXYG'><q id='CQXYG'></q></dir></style></legend>