title: Button click does not fire on second click
body: <p>I have a lot of buttons with the class <code>search_camera_btn</code>.</p>
  <p>When clicking on the button then it submits a form. This step works. On the other side, it should also trigger a button click event.</p>
  <p>I wrote the event listener in a coffeescript file which sends Ajax requests, but it only works on the first click.</p>
  <p>I put the code in this <a href="https://gist.github.com/poc7667/7407354" rel="nofollow noreferrer">gist</a>.</p>
  <p>The Javascript <strong>works when the button is clicked the first time, but fails on subsequent clicks.</strong></p>
  <p>Actually I put a alert message in the begin of click event handler,
  But it only alerts at the first time.
  And there is no error message in my Firbug console. (I thought it is just didn't fire the click event handler.)</p>
  <pre><code>$(&quot;.search_camera_btn&quot;).click -&gt;
      alert &quot;test&quot;
  </code></pre>
  <p>There are many buttons,no matter which button I click.
  It always works at the first time click.
  Here is my more detail source code. <a href="http://d.pr/f/mnkY" rel="nofollow noreferrer">download</a></p>
  <p>Any ideas?</p>
  <hr />
  <p>I narrow down the buggy code.That is the &quot;Ready to enter start&quot; message only called at the first time.
  But there is no error showed on the Firebug Javascript console and Rails console.
  Should I enable some settings in the development mode ?</p>
  <pre><code>IW2 = get_camera_list: -&gt;
      console.log(&quot;Start&quot;)
  
      ajax_req = $.ajax
        url: &quot;update_camera_list/&quot;
        type: &quot;GET&quot;
        success: (resp) -&gt; 
          # console.log resp
  
      res = setTimeout (-&gt;
        ajax_req
        ), 500
      console.log(&quot;End&quot;)
      return
  jQuery -&gt;
    $(&quot;.search_camera_btn&quot;).click -&gt;
      console.log(&quot;Ready to enter start&quot;)    
      IW2.get_camera_list()
  </code></pre>
  <h3>Compiled CoffeeScript:</h3>
  
  <pre><code>var IW2;
  
  IW2 = {
    get_camera_list: function() {
      var ajax_req, res;
      console.log(&quot;Start&quot;);
      ajax_req = $.ajax({
        url: &quot;update_camera_list/&quot;,
        type: &quot;GET&quot;,
        success: function(resp) {}
      });
      res = setTimeout((function() {
        return ajax_req;
      }), 500);
      console.log(&quot;End&quot;);
    }
  };
  
  jQuery(function() {
    return $(&quot;.search_camera_btn&quot;).click(function() {
      console.log(&quot;Ready to enter start&quot;);
      return IW2.get_camera_list();
    });
  });
  </code></pre>