Title: Uncaught ReferenceError: jQuery is not defined
Last modified: August 31, 2016

---

# Uncaught ReferenceError: jQuery is not defined

 *  [Mauricio Macas](https://wordpress.org/support/users/getmovil/)
 * (@getmovil)
 * [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/)
 * Hi, your plugin dont work with jquery from google cdn, apperas this:
 * Uncaught ReferenceError: jQuery is not defined in line 72
 * <script type=’text/javascript’>
    line 72: jQuery(document).ready(function($) {
   $(‘#googleplus-after-38’).sharrre({
 * How can fixed??
 * [https://wordpress.org/plugins/genesis-simple-share/](https://wordpress.org/plugins/genesis-simple-share/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/#post-7403885)
 * Hi, Mauricio.
 * Can you share a link to a page that displays this error, please? It sounds like
   there may be two versions of jQuery included on the page.
 *  Thread Starter [Mauricio Macas](https://wordpress.org/support/users/getmovil/)
 * (@getmovil)
 * [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/#post-7403916)
 * Hi, Nick
 * Please see any single post in getmovil this warning appears in code source, right
   now i have mashare plugin to share my single post, but with o without another
   social sharing plugin, Genesis Simple Share dont work.
 * Thanks for you great support.
 *  Thread Starter [Mauricio Macas](https://wordpress.org/support/users/getmovil/)
 * (@getmovil)
 * [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/#post-7403930)
 * Looks like WP deferred javaScript plugin cause the error, the same bug appears
   when i use jquery from google cdn in async o defer mode, how can fixed??
 *  [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/#post-7404118)
 * Thanks for mentioning that you’re loading jQuery with the defer attribute, Mauricio.
   That sheds new light on this.
 * The error is appearing because the plugin’s inline script will be loaded before
   jQuery. To work around this, you could defer loading of inline scripts by removing
   them and adding them after jQuery has loaded. One way to do that is to add this
   code to your active theme’s functions.php file:
 *     ```
       add_action( 'after_setup_theme', 'defer_genesis_responsive_slider', 16 );
   
       function defer_genesis_responsive_slider() {
       	remove_action( 'wp_footer', 'genesis_responsive_slider_flexslider_params' );
       	add_action( 'wp_footer', 'custom_genesis_responsive_slider_flexslider_params' );
       }
   
       function custom_genesis_responsive_slider_flexslider_params() {
   
       	$timer        = ( int ) genesis_get_responsive_slider_option( 'slideshow_timer' );
       	$duration     = ( int ) genesis_get_responsive_slider_option( 'slideshow_delay' );
       	$effect       = genesis_get_responsive_slider_option( 'slideshow_effect' );
       	$controlnav   = genesis_get_responsive_slider_option( 'slideshow_pager' );
       	$directionnav = genesis_get_responsive_slider_option( 'slideshow_arrows' );
   
       	$output = 'function sliderDefer(method) {
       		if (window.jQuery) method(); else setTimeout(function() { sliderDefer(method) }, 50);
       	}
   
       	function sliderParams(){
       		jQuery(document).ready(function($) {
       			$(".flexslider").flexslider({
       				controlsContainer: "#genesis-responsive-slider",
       				animation: "' . esc_js( $effect ) . '",
       				directionNav: ' . $directionnav . ',
       				controlNav: ' . $controlnav . ',
       				animationDuration: ' . $duration . ',
       				slideshowSpeed: ' . $timer . '
       	        });
       	    });
       	}
   
       	sliderDefer( sliderParams );
       	';
   
       	$output = str_replace( array( "\n", "\t", "\r" ), '', $output );
   
       	echo '<script type=\'text/javascript\'>' . $output . '</script>';
       }
       ```
   
 * That will defer loading of the inline slider script until after jQuery is loaded,
   and should prevent the error you were seeing.
 *  Thread Starter [Mauricio Macas](https://wordpress.org/support/users/getmovil/)
 * (@getmovil)
 * [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/#post-7404129)
 * Hi, thanks for you support.
 * With your code appears this warning:
 * Fatal error: Call to undefined function genesis_get_responsive_slider_option()
   in C:\xampp\htdocs\blog\wp-content\themes\getmovil\functions.php on line 129
 * Line 129: $timer = ( int ) genesis_get_responsive_slider_option( ‘slideshow_timer’);
 * In my child theme i dont use genesis responsive slider or responsive_slider_flexslider
   or superfish, i have this in my functions.php:
 *     ```
       //* Enqueue Scripts and Styles
       add_action( 'wp_enqueue_scripts', 'getmovil_enqueue_scripts_styles' );
       function getmovil_enqueue_scripts_styles() {
       	wp_enqueue_script( 'getmovil-responsive-menu', get_stylesheet_directory_uri() . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0', true );
       	$output = array(
       		'mainMenu' => __( 'Menu', 'getmovil' ),
       		'subMenu'  => __( 'Menu', 'getmovil' ),
       	);
       	wp_localize_script( 'getmovil-responsive-menu', 'getmovilL10n', $output );
       }
       // Remove jQuery Migrate Script from header and Load jQuery from Google API
       function crunchify_remove_jquery_migrate_load_google_hosted_jquery() {
       	if (!is_admin()) {
       		wp_deregister_script('jquery');
       		wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js', false, null);
       		wp_enqueue_script('jquery');
       	}
       }
       add_action('init', 'crunchify_remove_jquery_migrate_load_google_hosted_jquery');
       ```
   
 * Best regards.
 *  [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/#post-7404130)
 * Edit: Sorry, Mauricio – I cross-posted my original suggestion on the wrong plugin
   board.
 * I’ll take a look at Simple Share and async loading shortly…
 *  Thread Starter [Mauricio Macas](https://wordpress.org/support/users/getmovil/)
 * (@getmovil)
 * [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/#post-7404132)
 * Hi, with your new code, dont appears any warning, but appears the same error 
   in chrome console:
 * localhost/:76 Uncaught ReferenceError: jQuery is not defined
 * Line 76: jQuery(document).ready(function($) {
 * I dont use Responsive Slider plugin.
 * Thanks for you support.
 *  [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/#post-7404133)
 * Unfortunately there is not a simple way to delay loading of inline scripts with
   Genesis Simple Share to account for deferred loading of jQuery. (It is possible,
   but would require editing the plugin.)
 * Your best options are to either:
    - load jQuery without the defer attribute
    - use a share plugin that does not require JavaScript, such as [https://wordpress.org/plugins/fast-social-share-buttons/](https://wordpress.org/plugins/fast-social-share-buttons/)
      or [https://wordpress.org/plugins/naked-social-share/screenshots/](https://wordpress.org/plugins/naked-social-share/screenshots/)(
      with “disable JavaScript” enabled in the plugin’s options).
 * (Sorry for the confusion, Mauricio – I originally thought this topic was posted
   in the Genesis Responsive Slider forum.)

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Uncaught ReferenceError: jQuery is not defined’ is closed to new replies.

 * ![](https://ps.w.org/genesis-simple-share/assets/icon.svg?rev=3358434)
 * [Genesis Simple Share](https://wordpress.org/plugins/genesis-simple-share/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/genesis-simple-share/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/genesis-simple-share/)
 * [Active Topics](https://wordpress.org/support/plugin/genesis-simple-share/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/genesis-simple-share/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/genesis-simple-share/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Nick C](https://wordpress.org/support/users/modernnerd/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-8/#post-7404133)
 * Status: not resolved