Kausha Mehta
Kausha Mehta

Reputation: 2928

TypeError: jQuery.easing[jQuery.easing.def] is not a function

I have one slider on the same page which is using jQuery version jquery-1.7.1.min.js, and on the same page I'm using the Contact Form-7 and it uses [my site url]/wp-includes/js/jquery/jquery.js?ver=1.11.1. This both jQuery conflict with each other.

I also de-register the jQuery of Contact Form-7, then when I click on send button it will reload the whole page. I don't want to reload the whole page on contact form-7's button click.

Upvotes: 0

Views: 12157

Answers (4)

Iulian Paraian
Iulian Paraian

Reputation: 86

For others that have the same issue try using the jquery.easing.compatibility.js - if you don't want to have to change your easing type names - as it says on the plugin page

I solved my problem this way.

Upvotes: 1

Luis
Luis

Reputation: 276

It happens because Contact Form 7 requires wp_head and wp_footer in order to get to work properly with ajax calls. That means you probably are calling header or footer twice.

A workaround: Don't declare the script on the header, call it through jQuery's .getScript() function when the document is fully loaded.

Example:

<script>
$( document ).ready(function() {
    $.getScript('path_to_script/easing_script_name.js');
});
</script>

The error is due to that jQuery is called before easing script it's fully loaded.

Upvotes: 1

Carson Reinke
Carson Reinke

Reputation: 723

Best way would be to turn off jQuery for Contact Form 7 in wp-config.php:

define('WPCF7_LOAD_JS', false);

https://wordpress.org/support/topic/plugin-contact-form-7-jquery-version-conflict-want-to-disable-wordpress-jquery-insertion https://ideasilo.wordpress.com/2009/05/31/contact-form-7-1-10/

Upvotes: 1

user2439481
user2439481

Reputation:

I got issue.

I think you have added hook in function.php right ?

If yes then first revert your hook. And put it as default.

And then put all jquery (included jquery) from header to footer.

Now check your issue is solve.

Upvotes: 4

Related Questions