title: ajax and “Uncaught ReferenceError: data is not defined”
body: <h2>In Chrome console, the message error is :</h2>
  
  <h3>Uncaught ReferenceError: data is not defined</h3>
  
  <pre><code>    function list(){
  
      $.ajax({
          type:'POST',
          url:'adeneme.php',
          data:$('#form1').serialize(),
          success: function (data) {
  
           console.log(data);
           $('#snc').html(data);
  
          },
        error: function(x) {
  
  
        console.log(data);    
        $('#snc').html("Error:"+x); 
        }
      });
  }
  </code></pre>
  
  <p><strong>adeneme.php ;</strong></p>
  
  <pre><code>    &lt;?php
  
  if(isset($_POST["seans"]) &amp;&amp; isset($_POST["date"])){
      $seans=$_POST["seans"];
     $tarih=$_POST["date"];
  
     echo $seans."  ".$tarih;
  }
  ?&gt;
  </code></pre>
  
  <p><strong>What is going wrong ? What to do ?</strong></p>
  
  <p><strong>Edit</strong>: all is done client side.</p>