how to enable ajax on submitting of contact form 7?

Not sure about ajax, but you could use a custom DOM event to run some javascript… From the “contact form 7” documentation: The simplest way is utilizing Contact Form 7’s custom DOM event to run JavaScript. The following is an example of script that redirects you to another URL when the wpcf7mailsent event occurs: <script> … Read more

ajax polling with admin-ajax.php

You idea is equivalent to DDOSing your site, and the difference between the methods is only how fast you will bring the site down. WordPress AJAX handling is expensive, and should be limited to user initiated actions. Your second method will be more resilient but you are still going to be wasting server resources as … Read more