0

I have visual composer installed on a wordpress site. For some reason when i isert and image or any element and apply the animation from inside visual composer, the page goes blank and nothing shows, no animations, nothing.

After contacting the plugin developer they said another plugin is conflicting but i have just 1 other plugin installed, jetpack. I have uinstalled that and the problem persists.

Using the debug tool i get the following errors. any ideas?

Uncaught TypeError: a.indexOf is not a function at r.fn.init.r.fn.load (jquery.min.js?ver=3.1.1:4) at waypoints.min.js?ver=5.0.1:8 at waypoints.min.js?ver=5.0.1:8 at waypoints.min.js?ver=5.0.1:8 at waypoints.min.js?ver=5.0.1:8

Uncaught TypeError: f.getClientRects is not a function at r.fn.init.offset (https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js?ver=3.1.1:4:20376) at t.refresh (http://####/wp-content/plugins/js_composer/assets/lib/waypoints/waypoints.min.js?ver=5.0.1:8:2072) at t. (http://#####/wp-content/plugins/js_composer/assets/lib/waypoints/waypoints.min.js?ver=5.0.1:8:6130) at Function.each (https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js?ver=3.1.1:2:2865) at refresh (http:#####/wp-content/plugins/js_composer/assets/lib/waypoints/waypoints.min.js?ver=5.0.1:8:6100) at Function.n.(anonymous function) [as waypoints] (http://###wp-content/plugins/js_composer/assets/lib/waypoints/waypoints.min.js?ver=5.0.1:8:7638) at r.fn.init.init (http://####/wp-content/plugins/js_composer/assets/lib/waypoints/waypoints.min.js?ver=5.0.1:8:4817) at r.fn.init.n.fn.(anonymous function) [as waypoint] (http://######/wp-content/plugins/js_composer/assets/lib/waypoints/waypoints.min.js?ver=5.0.1:8:5712) at function.window.vc_waypoints.window.vc_waypoints (http://####/wp-content/plugins/js_composer/assets/js/dist/js_composer_front.min.js?ver=5.0.1:1:7243)

1 Answer 1

3

By default, the latest version of WordPress uses jQuery version 1.12.4 but your site seems to be calling jQuery 3.1.1 via Google's CDN. It's possible that Visual Composer isn't compatible with jQuery 3 yet.

If this is the only plugin on the site, then it's likely the theme calling this jQuery version. And if it's properly coded, you should be able to find a wp_register_script or wp_enqueue_script function that is overriding the jQuery version. If you replace that with wp_enqueue_script( 'jquery' );, you'll load up WordPress' jQuery which may solve the issue.

Three notes:

  1. The theme may have replaced jQuery by using wp_deregister_script. You'll need to comment that out too.
  2. Changing the jQuery version may break javascript coming from your theme if that js needs jQuery version 3 so look for issues on that end as well.
  3. When you update your theme, it will revert this change. So you should consider doing this through a child theme to preserve your changes across updates.
Sign up to request clarification or add additional context in comments.

4 Comments

Hello, thank you so much for the answer this makes sence as i made a function that changes the way wordpress uses Jquery: //Making jQuery Google API function modify_jquery() { if (!is_admin()) { // comment out the next two lines to load the local copy of jQuery wp_deregister_script('jquery'); wp_register_script('jquery', 'ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js', false, '3.1.1'); wp_enqueue_script('jquery'); } } add_action('init', 'modify_jquery');
Thank you removing that function solved the problem.
If you're wanting to use a CDN for speed/caching purposes, you can use Google's version of jQuery. Just make sure you use the same jQuery that WordPress is using. Glad I could help!
Thanks yeah the problem is some third party stuff needs higher Jquery than the low 1.12...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.