title: JQuery Ajax Json Response Does not Work
body: <p>Form part :</p>
  
  <pre><code>&lt;script type="text/javascript" src="js/aboneol.js"&gt;&lt;/script&gt;
                      &lt;h4&gt;haberdar olun&lt;/h4&gt;
                      &lt;div class="news_letter"&gt;
                          &lt;span id="aboneolhata"&gt;&lt;/span&gt;
                          &lt;form action="" method="post" onsubmit="return false;" id="abone"&gt;
                              &lt;input type="text" name="email" placeholder="E-posta adresiniz" /&gt;
                              &lt;input type="submit" onclick="$.aboneol();" value="abone ol" /&gt;
  
                          &lt;/form&gt;
                      &lt;/div&gt;
  </code></pre>
  
  <p>Jquery part :</p>
  
  <pre><code>$.aboneol = function(){
      var deger = $("form#abone").serialize();
      $.ajax({
          url: "aboneol.php",
          data: deger,
          dataType: "json",
          type: "post",
          success: function(response){
              if(response.error == 0){
                  $(".news_letter").html(response.message);
              }else{
                  $("#aboneolhata").html(response.message);
              }
          }
      });
  }
  </code></pre>
  
  <p>And here is php part :</p>
  
  <pre><code>&lt;?php
  $email = $_POST["email"];
  $email = trim($email);
  
  if(empty($email)){
      $response["error"] = 1;
      $response["message"] = "Boş Bırakamazsınız..";
  }else if(filter_var($email, FILTER_VALIDATE_EMAIL) === false){
      $response["error"] = 1;
      $response["message"] = "Hatalı E-posta..";
  }else{
      require "database.php";
      $pdo = Database::connect();
      $sql = "INSERT INTO aboneler (email) VALUES (:email)";
      $q = $pdo-&gt;prepare($sql);
      $q-&gt;execute(array(
                  ':email'=&gt;$email,
                  ));
      $response["error"] = 0;
      $response["message"] = $email;
  }
  echo json_encode($response);
  ?&gt;
  </code></pre>
  
  <p>Ajax sends the email to php, and http response code is 200. But success method does not work. Also i cant see any json response in success method. How to solve this problem? </p>