Uncaught TypeError: Cannot read property 'message' of undefined
30,879
The error is because responseJSON
isn't a standard property or one that jQuery makes available for XMLHttpRequest
s.
You'll want to use responseText
instead, which may be parsable:
contactForm.addAjaxMessage($.parseJSON(response.responseText).message, true);
// or
contactForm.addAjaxMessage(response.responseText, true);
Author by
Admin
Updated on March 11, 2020Comments
-
Admin about 4 years
I am trying to implement an AJAX contact form for my site, the problem I am encountering is that when I click on submit I get the following error in Google Chrome:
"Uncaught TypeError: Cannot read property 'message' of undefined----contact-form.js:38".
Please find the HTML code and contact-from.js.