title: jQuery, ajax, json, php parsererror
body: <p>I'm trying to get an ajax request running, but I get a parsererror.
  This is my Javascript Code:</p>
  
  <pre><code>$.ajax({
              type: 'POST',
              url: 'insertuser.php',
              dataType: 'json',
              data: {
                  nickname: $('input[name=nickname]').val(),
                  passwort: $('input[name=passwort]').val()
              },
              success : function(data){
                  console.log(data);
              },
              error : function(XMLHttpRequest, textStatus, errorThrown) {
                  console.log("XMLHttpRequest", XMLHttpRequest);
                  console.log("textStatus", textStatus);
                  console.log("errorThrown", errorThrown);    
              }
          });
  </code></pre>
  
  <p>Thats the php file:</p>
  
  <blockquote>
    <p>$return['error'] = false;<br>
      $return['msg'] = "juhuuu";   </p>
    
    <p>echo json_encode($return);</p>
  </blockquote>
  
  <p>This is the console.log:</p>
  
  <p>XMLHttpRequest Object
  textStatus parsererror 
  errorThrown SyntaxError</p>
  
  <p>Thats what the .php echos:
  {"error":false,"msg":"juhuuu"}</p>
  
  <p>I hope someone has an idea :)</p>