display messages from server in my contact form with jQuery Ajax and JSON

display messages from server in my contact form with jQuery Ajax and JSON

hello everyone i habe a problem to display my successes and errors messages in Browsers Firefox and IE. my messages are displaying in a different browser window and not in he set Tags from my html.
Here you can see my code:
  1. $('#abschicken').click(function() {
  2. event.preventDefault();
  3.     // get the form data
  4. var formData = {
  5. 'name' : $('input[name=name]').val(),
  6. 'email' : $('input[name=email]').val(),
  7. 'tel' : $('input[name=tel]').val(),
  8. 'bemerkung' : $('textarea[name=bemerkung]').val()
  9. };
  10. // process the form
  11. $.ajax({
  12. type : 'POST', 
  13. url         : 'phpmailer/index.php', 
  14. data : formData, 
  15. dataType : 'json',
  16. encode : true
  17. })
  18. // process the form
  19. .done(function(data) {

  20. // log data 
  21. console.log(data); 

  22. // handle errors and validation results
  23. if (!data.success) {
  24. // handle errors for name ---------------
  25. if (data.errors) {
  26. $('#name').addClass('has-error'); // add the error class to show red input
  27. $('div#result').addClass('error').html(data.errors); // add the actual error result under our input 
  28. }
  29. // handle errors for email ---------------
  30. if (data.errors) {
  31. $('#email').addClass('has-error'); // add the error class to show red input
  32. $('div#result').addClass('error').html(data.errors); // add the actual error result under our input
  33. }
  34. if (data.errors) {
  35. $('#tel').addClass('has-error'); // add the error class to show red input
  36. $('div#result').addClass('error').html(data.errors); // add the actual error result under our input
  37. }
  38. } else {
  39. $('#contact-form').slideUp( "slow", function(){
  40. $('div#result').removeClass('error');
  41. $('div#open-window').addClass('success').html(data.success);
  42. // $('div#open-window').addClass('success').append( "<p>Danke, wir rufen Sie an.!</p>" );
  43. $('.close-window').css('display', 'inherit');
  44. });

  45. }
  46. if (data.complete){
  47. $('#divMsg').hide();
  48. }
  49. })//done function

  50. });//click button
  51.  
in my PHP script is everything right otherwise i could receive any answer messages from server. i don't really know, where is the problem :-(  i appreciate  any helps! Thank you!