title: Jquery POST Json return
body: <p>i have a jquery script, which posts my form. here it is:</p>
  
  <pre><code>$(document).ready(function(){
  $("form#submit").submit(function() {
  
  
  var an      = $('#an').attr('value');
  var betreff = $('#betreff').attr('value');
  var text    = $('#text').attr('value');
  
      $.ajax({
          type: "POST",
          url: "newmsg.php",
          data: "an="+ an +"&amp; betreff="+ betreff +"&amp;text="+ text,
          success: function(){
  
              $('#window').html(name);                
  
          }
      });
  return false;
  });
  });
  </code></pre>
  
  <p>my newmsg.php file</p>
  
  <pre><code>&lt;?php if($_POST['an']=="john") { echo json_encode(array("name"=&gt;"hi john")); } ?&gt;
  </code></pre>
  
  <p>my problem is, that my php file will not return the name, so my div #window does not post the message</p>
  
  <p>hope you guys understand...</p>
  
  <p>thank you very much</p>