• Resolved geckodesign

    (@geckodesign)


    I get the following console error on my landing page. I cant understand what this error means? Any help would be appreciated!

    Uncaught TypeError: wpcf7.initForm is not a function
    at HTMLFormElement.<anonymous> (/wp-content/plugins/contact-form-7/includes/js/scripts.js:33)
    at Function.each (/wp-includes/js/jquery/jquery.js:2)
    at a.fn.init.each (/wp-includes/js/jquery/jquery.js:2)
    at HTMLDocument.<anonymous> (/wp-content/plugins/contact-form-7/includes/js/scripts.js:31)
    at i (/wp-includes/js/jquery/jquery.js:2)
    at Object.add [as done] (/wp-includes/js/jquery/jquery.js:2)
    at n.fn.init.n.fn.ready (/wp-includes/js/jquery/jquery.js:2)
    at a.fn.init.n.fn.init (/wp-includes/js/jquery/jquery.js:2)
    at a.fn.init (/wp-includes/js/jquery/jquery-migrate.min.js:2)
    at n (/wp-includes/js/jquery/jquery.js:2)

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    What other plugins do you use on the site?

    Thread Starter geckodesign

    (@geckodesign)

    Akismet Anti-Spam
    CM Custom Post Types (my plugin)
    CM Widgets (my plugin)
    Contact Form 7
    Google Analytics for WordPress by MonsterInsights
    WP deferred javaScript
    WP Updates Notifier
    WP Smush
    Yoast SEO
    WP-PageNavi

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Try deactivating the WP deferred javaScript.

    I am also having trouble with the latest version of Contact Form 7 (4.9.1) and an AJAX loading plugin.

    I was able to solve my problem by moving the jQuery “on ready” function in scripts.js that calls wpcf7.initForm to after the initForm function is defined. I think the code works on the first load, when the DOM is still loading, but on an AJAX load when the DOM is already loaded, initForm gets called before it is defined.

    I know this is a quirky case, but perhaps you could consider this change in a later version of the plugin.

    Thanks.

    Thank you @danielshorten

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Uncaught TypeError: wpcf7.initForm is not a function’ is closed to new replies.