Uncaught TypeError: undefined is not a function
-
Hi, I’ve been trying to get your plugin to work in a new theme I’m doing, but I appear to have some issues that might be related to jQuery loading…
In my functions.php, I load Bootstrap as such:
if (function_exists('wpbootstrap_scripts_with_jquery')) { function wpbootstrap_scripts_with_jquery() { if (!is_admin()) { wp_register_script( 'bootstrap-js', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', array( 'jquery' ), '3.3.1', true ); wp_register_style( 'bootstrap-css', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css', array(), '3.3.1', 'all' ); wp_enqueue_script('bootstrap-js'); wp_enqueue_style('bootstrap-css'); } } add_action( 'wp_enqueue_scripts', 'wpbootstrap_scripts_with_jquery' ); }
And here’s the excerpts from my header file:
<?php wp_enqueue_script("jquery"); ?> <?php wp_head(); ?>
and
<?php echo do_shortcode('[image-carousel]'); ?>
The issue that occurs is that the below lines produce an error:
jQuery(document).ready(function() { jQuery('#cptbc_901').carousel({ interval: 5000 }); });
You can see the error in the below screenshot:
https://www.ads-software.com/plugins/cpt-bootstrap-carousel/
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Uncaught TypeError: undefined is not a function’ is closed to new replies.