title: do not receive the POSTed data in php code ( cakephp)
body: <p>I am trying to use ajax for retrieving data from my server. I use cakephp and jquery.
  The ajax code is as follows:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function(){
    $(".viewMode").click(function(){
          $.ajax({
              type: "POST",
              url:"viewModeSwitching",
              data: {
                  mobileViewCookie:12,
                  },
              success:function(result){
  //          window.location.href = result;
               }
          }
  );
  
    });
  
  
  });
  &lt;/script&gt;
  ...
  &lt;?php
      echo "&lt;br&gt;";
      echo $this-&gt;Form-&gt;button(__('Desktop View'), array('type' =&gt; 'button','class'       =&gt;"viewMode",));
      echo "&lt;br&gt;";    
  ?&gt;
  </code></pre>
  
  <p>This works well, in firebug I see that the POST is sent with value mobileViewCookie=12.
  The point is that my cakephp controllerfunction 'viewModeSwitching' cannot retrieve that data.
  I checked $this->data, $this->params, $_POST, etc but no sign of the data that had been send in the POST message.
  Any suggestions?</p>
  
  <p>/Antoine</p>