Joy
(@joyously)
This theme does not use jQuery, so the fault must be with your plugin.
But we enqueue the inbuilt jquery.
//wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
wp_enqueue_script( 'jquery' );
Thanks
-
This reply was modified 7 years, 3 months ago by
A WP Life.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Perhaps your plugin uses jQuery before it is output on the page – but that would be a plugin issue.
The plugin enqueuing the js in the plugin’s shortcode file code.
How can I determine like when will the plugin’s shortcode enqueue js on the page load?
Can you guide us? Do I need some hook/action to load jquery before page output?
Thanks for the reply.
-
This reply was modified 7 years, 3 months ago by
A WP Life.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Look at the page source – View the Webpage, right click and press ‘view source’ (or a similarly named option).
Search for where jQuery is being enqueued and note down its line number.
Then search for where your plugin JS is being enqueued.
Your plugin JS should be after the jQuery script in the page source.
–
The other time I’ve seen a similar error to what you’ve described is when the plugin loads its own version of jQuery (which is bad) and then you end up with 2 instances of jQuery.
Thanks and perfect trick to track. Will check and get back to you if need any help.
Joy
(@joyously)
The script that uses jQuery should be enqueued with array('jquery') as the dependency parameter. That way they will be output in the correct order.