title: JsHelper and Ajax not working in Cakephp
body: <p>I seriously can' understand what is going on here !The Jquery is not working at all ! The script is getting generated and everything. but when I click on the submit button it follows the same process as without jquery and ajax.
  Please help ! thanks.
  Here is my, Controller:
  
  
  <pre><code>class MessagesController extends AppController{
  
      public  $helpers=array('Js'=&gt;array('Jquery'));
      public $components = array('RequestHandler');
  
      public function index(){
          if(!empty($this-&gt;data)){
              if($this-&gt;Message-&gt;save($this-&gt;data)){
                  if($this-&gt;RequestHandler-&gt;isAjax()){
                      $this-&gt;render('success','ajax');
                      $this-&gt;Session-&gt;setFlash('Ajax');   
                  }
              }
          }
      }
  
  }
  </code></pre>
  
  <p>?>
  and here is my View:</p>
  
  <pre><code>&lt;?php echo  $this-&gt;Html-&gt;script('jquery',FALSE); ?&gt;
  &lt;?php
  echo $this-&gt;Form-&gt;create();
  echo $this-&gt;Form-&gt;input('name',array('id'=&gt;'id'));
  echo $this-&gt;Form-&gt;input('email',array('id'=&gt;'email'));
  echo $this-&gt;Form-&gt;input('message',array('id'=&gt;'message'));
  echo $this-&gt;Js-&gt;submit('Submit',array(
  'before'=&gt;$this-&gt;Js-&gt;get('#sending')-&gt;effect('fadeIn') ,
  'success'=&gt;$this-&gt;Js-&gt;get('#sending')-&gt;effect('fadeOut'),
  'update'=&gt;'#success'
   ));
  echo $this-&gt;Form-&gt;end();
  ?&gt;
  &lt;div id="sending" style="display:none;background-color:green" &gt;Sending...&lt;/div&gt;
  &lt;div id="success"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>This is the javascript file being generate,</p>
  
  <pre><code>$("#submit-84782947").bind("click", function (event) {$.ajax({beforeSend:function                   (XMLHttpRequest) {$("#sending").fadeIn();}, complete:function (XMLHttpRequest, textStatus) {$("#sending").fadeOut();}, data:$("#submit-84782947").closest("form").serialize(),   dataType:"html", success:function (data, textStatus) {$("#success").html(data);},       type:"post", url:"\/Cake\/messages"});
  </code></pre>
  
  <p>return false;});</p>
  
  <p>As I noticed there is no $(document).ready stuff in the generate file, could that be the problem ?</p>