AJAX Error
-
Getting “Unexpected token h in JSON at position 0” error after submitting a form.
Looking at the response, the URL of the website is being added before the JSON data which is why the error occurs.
The response should be:
{"mailSent":true,"into":"#wpcf7-f19812-o1","captcha":null,"message":"Your subscription to our mailing list has been confirmed. Thank you for subscribing.","onSentOk":["document.getElementById('footerform').style.display = 'none';"]}
But what is being returned is:
https://www.urlofwebsite.com/{"mailSent":true,"into":"#wpcf7-f19812-o1","captcha":null,"message":"Your subscription to our mailing list has been confirmed. Thank you for subscribing.","onSentOk":["document.getElementById('footerform').style.display = 'none';"]}
Any fixes for this issue?
- The topic ‘AJAX Error’ is closed to new replies.