title: Handle Ajax request and response zend framework
body: <p>I want to send Ajax request to controller, I make like this in the client side</p>
  
  <pre><code>jQuery.ajax({
      url: "public/visits/visit/get-visits",
      type: "POST",
      dataType: 'json',
      data: data,
      success: function(data){
          alert(data)
      },
      error:function(){
          alert("fail :(");
      }
  });
  </code></pre>
  
  <p>at the server side I handle the request as other requests</p>
  
  <pre><code>public function getVisitsAction() {
  if (isset($_POST)) {
      $mapper = new Visits_Model_VisitsMapper();
      $allVisits = $mapper-&gt;getAllVisits();
      echo json_encode($allVisits);
   }
  </code></pre>
  
  <p>When I call the action, fail alert occurs and when I check it out through fire bug I found that it  returns the json data to client side to page get-visit.phtml.</p>
  
  <p>How can I handle the response in the success function from the page that send the json request and redirecting it to get-visit.phtml page? </p>