jQuery 1.4.*, Contact Form 7 v2.2.2 and JSON (and Tracking with Analytics)
-
Okay.. I had some serious trouble with my Contact Form 7 implementation.
First I updated the jQuery library to 1.4 (I’m not 100% sure but WP is using 1.3 atm).
This causes the main problem. Since 1.4 jQuery doesn’t support “invalid” JSON syntax (use https://www.jsonlint.com/ to test if yours valid) even if its valid javascript, pretty annoying!! (I found this reason after a couple hours of testing, first I tought my tracking code “Additional Settings” causes the problem).
Okay I was running Contact Form 7 2.1.1 on my system. I upgraded to 2.1.2 (see changelog: “Incorrect JSON syntax causing conflict with jQuery 1.4 has been fixed.”) and I got no longer JSON errors.
So I reentered my tracking code and again I got JSON errors. Finanlly I found out that JSON implementation of Contact Form is still not working properly. I replaced the function wpcf7_json in controller.php on line 103 with the PHP json encoder (since version 5.2) and voila: it works! With my analtics code!
I hope this report helps other people to solve their problems faster.
- The topic ‘jQuery 1.4.*, Contact Form 7 v2.2.2 and JSON (and Tracking with Analytics)’ is closed to new replies.