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)

user1673498
  • 431
  • 1
  • 8
  • 26

1 Answers1

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.
I'm Joe Too
  • 5,468
  • 1
  • 17
  • 29
  • 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', 'https://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'); – user1673498 Feb 19 '17 at 14:13
  • Thank you removing that function solved the problem. – user1673498 Feb 19 '17 at 14:14
  • 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! – I'm Joe Too Feb 19 '17 at 14:18
  • Thanks yeah the problem is some third party stuff needs higher Jquery than the low 1.12... – user1673498 Feb 19 '17 at 14:20