title: Unexpected token I JSON
body: <p>I am trying to use ajax on a registration page in order to show either succes or errors. I cannot figure out why i get "Uncaught SyntaxError: Unexpected token I " in the console. Here is the code: </p>
  
  <pre><code>$("#submit").click(function(){
      var name = $('#name').val();
      var surname = $('#surname').val();
      var username= $('#userName').val();
      var email = $('#email').val();
      var country = $('#country option:selected').text();
      var password1 = $('#password1').val();
      var password2 = $('#password2').val();
  
      $.ajax({
        url: "ajax-api.php",
        type:'post', data:{name:name, surname:surname, username:username, email:email, country:country, password1:password1, password2:password2, submit:'yes'}
      }).done(function(response) {
        var errors = JSON.parse(response);
        if(errors != ''){
          var outputString = '';
          for(var key in errors){
              outputString += errors[key]+'&lt;br /&gt;&lt;br /&gt;';
          }
          alertify.error(outputString);
        }else{
          alertify.succes('You have been registered!');
        }
      });
  
      });
  });
  </code></pre>
  
  <p>The console says the error is in line 20 (<code>var errors = JSON.parse(response);</code>)</p>
  
  <p>EDIT:  I only get the console error in the success case( <code>alertify.succes('You have been registered!');</code>) </p>