Research I have done for this question and links:
How do you send console messages and errors to alert?
jQuery AJAX form using mail() PHP script sends email, but POST data from HTML form is undefined
The code example:
function handleError(evt) {
  if (evt.message) { // Chrome sometimes provides this
 $.ajax({
            type: "POST",
            url: "email.php",
            data: evt.message,
            success: function(){
            $('.success').fadeIn(1000);
            }
        });
  } else {
    $.ajax({
            type: "POST",
            url: "email.php",
            data: evt.type,
            success: function(){
            $('.success').fadeIn(1000);
            }
        });
  }
}
Question) What type of validation is required in "email.php" to be sure that the emails aren't malicious (to the extent that this is possible) IE: is there a vulnerability that you are exposing yourself to with this function. If there is a built in mechanism for changing the location of error logs in javascript, that too would answer this question.