title: Writing a callback function in coffeescript
body: <p>I'm having a little trouble understanding how to write call back functions in coffeescript functions. I have created this script and a couple functions...</p>
  
  <pre><code>$('form').submit (e) -&gt;
      console.log $(this)
      e.preventDefault()
      if $(this).hasClass 'volunteer-check-out-find-me-form'
          showFormLoader $(this), $(this).parent('aside.form').sibling('.form-loader'), -&gt;
              console.log 'finished'
  
  showFormLoader = (form, formLoader, callback) -&gt;
      'showing loader and hiding form'
      form.fadeOut -&gt;
          formLoader.addClass('show').one 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', -&gt;
              console.log 'calling back'
              callback()
  </code></pre>
  
  <p>But I'm getting this error in the console when I submit the form</p>
  
  <p><code>Uncaught TypeError: undefined is not a function</code></p>
  
  <p>On the line the function call is on, am I doing something wrong? Is there a better way to do this?</p>