Form Submit Error: SyntaxError: Unexpected token < in JSON at position 0

tiagovareta

Member
Hi,

I have a form with two plugins!
The first plugin (php / Star Of Form Submission), I use to handle the collected data. Send 2 emails and register in the database.
The second plugin (redirect), makes the referral to the thank-you page.

The issue is that as soon as I do "send", it gives the error: SyntaxError: Unexpected token < in JSON at position 0 , and no longer performs rerouting of the 2nd plugin ...

Can anyone help me in this situation?
 
Have a look in your browser dev console in the "Network" tab.
Usually the last entry will show an error message (some HTML code starting with <) instead of the expected JSON string which is creating this message.
 
Have a look in your browser dev console in the "Network" tab.
Usually the last entry will show an error message (some HTML code starting with <) instead of the expected JSON string which is creating this message.

Hi troester!

Thanks for the help / answer!
When I put the post, I had already researched and had not found a solution! However after placing it, I continued to see if I could find any information.
I found a user who had solved by putting the "ajaxify" module in "off" mode.

By putting the module "ajaxify" in "off" mode, there is no error.
Is this the correct way to solve the situation?
 
Did you do what Troester suggested, and look at the dev console?

The JS error you are seeing is because a PHP notice / warning /error is being included in the JSON response from the server. Looking in dev tools will show you what that error is, which will tell us where the problem is.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top