How come I keep seeing the error message "Failed to execute 'createComment' on 'Document': 1 argument required, but only 0 present?" even though my function is not supposed to take in any arguments?
<form onsubmit='createComment()' method='POST'>
var createComment = function () {
var author = $('#addCommentAuthor').val()
var email = $('#addCommentEmail').val()
var content = $('#addCommentContent').val()
var date = $('#addCommentDate').val()
$.ajax({
url: "controller.php",
type: 'POST',
data: {
commentType: commentType,
questionId: currentQuestionID,
add_comment_author: author,
add_comment_email: email,
add_comment_content: content,
add_comment_date: date
},
success: function(data) {
console.log(data)
}
})
}