I am working on a website, and I don't like to write mail scripts again and again. I am trying this Javascript:
<script>
$(document).ready(function(){
$("#button").click(function(e){
e.preventDefault();
var arr=createDomString($("#contactForm"));
console.log(arr);
//var data=createDomArray($("#contactForm"));
$.ajax({
type:'POST',
url:'php/mailer.php',
data:"datastring="+arr,
//datatype:"json",
success: function(d){
console.log("php response "+d);
}
});
});
});
</script>
However, I get this error
Uncaught ReferenceError: createDomString is not defined
Is there a problem with the script or am I doing something wrong?