• Resolved Rudolph Smits

    (@rudolph-smits)


    I am using CF7 and it runs fine. Recently I added the plugin Custom Facebook Feed. It runs on my site but denies to limit the length of the feeds. The plugin-author said that a fb-javascript did not run due to an error in a CF-script in scripts.js. The error text is this: “this.ajaxForm is not a function”.

    I am using CF7 for a contact form and a booking form (rental of holidayhomes). Those forms run well so apparently it is not a critical error for CF7. Besides CF7 I am using 4 other CF7-plugins.

    Can anyone give me a glue how to solve this “this.ajaxForm is not a function”-error? Again, it is not critical for CF7 itself but it causes the FB-feed not to run well.

    Kinds regards
    Rudolph Smits, Netherlands

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Rudolph Smits

    (@rudolph-smits)

    I was just told by the author of Customer Facebook Feed that this error also exists on an other site (www.vakantiehuisverhuur.eu). The FB-plugin has not yet been installed there. So the error is certainly a CF-7 issue. But harmless also there where it concerns the contact- and booking function.

    It looks like a incompatability between the two plugins. But can this be solved?

    Thread Starter Rudolph Smits

    (@rudolph-smits)

    It is a marriage between CF7 and a Facebook feed. Both partners are very well but in their relation there is a weakness. Does this contribute to solve it? It is a part of the CF7f-script in scripts.js with the ajaxForm instruction:

    (function($) {

    if (typeof _wpcf7 == ‘undefined’ || _wpcf7 === null) {
    _wpcf7 = {};
    }

    _wpcf7 = $.extend({
    cached: 0
    }, _wpcf7);

    $.fn.wpcf7InitForm = function() {
    this.ajaxForm({
    beforeSubmit: function(arr, $form, options) {
    $form.wpcf7ClearResponseOutput();
    $form.find(‘[aria-invalid]’).attr(‘aria-invalid’, ‘false’);
    $form.find(‘img.ajax-loader’).css({ visibility: ‘visible’ });
    return true;
    },

    etc. etc.

    Thread Starter Rudolph Smits

    (@rudolph-smits)

    In the first part a wrong sitename has been specified. However not very important I’d liked to correct this.
    The sitename is http://www.vakantiehuizenwallonie.nl.

    Is there anyone who can tell me in which file this ajaxForm-function is to be found. Possibly I have an incomplete CF-7 implementation.

    Thread Starter Rudolph Smits

    (@rudolph-smits)

    This problem has been solved. A friend found out that I had an old jQuery-implementation (ver 1.11 and at least 1.15 was needed). On internet I found some coding (below) to do the job and load version 2.1.4. That was the beginning of the solution. After some other changes the Facebook-feed worked allright.

    Cheers
    Rudolph Smits, Netherlands

    I have added this to a functions.php in my theme-child:

    function current_jquery($version) {
    global $wp_scripts;
    if ( ( version_compare($version, $wp_scripts -> registered[jquery] -> ver) == 1 ) && !is_admin() ) {
    wp_deregister_script(‘jquery’);
    wp_register_script(‘jquery’,
    http://ajax.googleapis.com/ajax/libs/jquery/’.$version.’/jquery.min.js’, false, $version);
    }
    }
    add_action( ‘wp_head’, current_jquery( ‘2.1.4’ ) ); // change number to latest version

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Contact Form 7: error this.ajaxForm is not a function’ is closed to new replies.