Ajax loaded page CF7
-
Hi everyone,
I’m building a website where pages are loaded via AJAX post requests. All was working dandily, till I noticed that CF7 doesn’t work when loaded this way (which, I supposed, was caused by wp_footer() not being ran on the ajax call). So I did this on the success callback for my AJAX call :
$.get('/wp-content/plugins/contact-form-7/includes/js/jquery.form.min.js?ver=3.50.0-2014.02.05', function(data) { eval(data); }); var _wpcf7 = {"loaderUrl":"\/wp-content\/plugins\/contact-form-7\/images\/ajax-loader.gif","sending":"Sending ..."}; $.get('/wp-content/plugins/contact-form-7/includes/js/scripts.js', function(data) { eval(data); });The scripts load fine (confirmed via Chrome’s network inspector), and no errors are shown on the console. But, when submitting the form, instead of making the form validation via Ajax and doing the normal CF7 behavior, a new page is opened showing only the content of the form element and the URL shows the hash of the form ID generated by CF7 (which is the form’s “action”).
What am I missing here ? Anyone has a clue ?
The topic ‘Ajax loaded page CF7’ is closed to new replies.