title: Coffeescript / Jquery binding events best practice
body: <p>Iam new to coffescript but i iam interested what is the best way to bind events from jquery to coffeescript class instance? Iam trying to prevent having too many nested callbacks in my class: </p>
  
  <pre><code>class Page
    id2clicks : 0
    id3clicks : 0
    id4clicks : 0
  
    onLoad: -&gt;
  
      $('#id2').on 'click', @ , @onId2Click
  
      $('#id3').on 'click', $.proxy(@onId3Click,@)
  
      $('#id4').on 'click' , () =&gt;
        @id4clicks++
        alert @id4clicks
  
    onId2Click: (e) -&gt;
      e.data.id2clicks++
      alert e.data.id2clicks
  
    onId3Click: -&gt;
      @id3clicks++
      alert @id3clicks
  
  p = new Page()
  p.onLoad()
  </code></pre>
  
  <p>All 3 methods works... is there any better way / recommandation to do this? </p>