Title: Jquery Load Problem
Last modified: August 19, 2016

---

# Jquery Load Problem

 *  [designrf](https://wordpress.org/support/users/designrf/)
 * (@designrf)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/jquery-load-problem/)
 * Hi Everybody,
 * I want to load jQuery in a good way. My problem is that jquery is on my page 
   but it looks like i can’t use it.
    I use that function in my functions.php (in
   my theme):
 *     ```
       function init_jquery() {
       	if (!is_admin()) {
       		wp_enqueue_script('jquery');
       	}
       }
       add_action('init', 'init_jquery');
       ```
   
 * I don’t have any plugin. My header.php looks like that:
 *     ```
       <?php
       	/* We add some JavaScript to pages with the comment form
       	 * to support sites with threaded comments (when in use).
       	 */
       	if ( is_singular() && get_option( 'thread_comments' ) )
       		wp_enqueue_script( 'comment-reply' );
   
       	/* Always have wp_head() just before the closing </head>
       	 * tag of your theme, or you will break many plugins, which
       	 * generally use this hook to add elements to <head> such
       	 * as styles, scripts, and meta tags.
       	 */
       	wp_head();
       ?>
   
       <script type="text/javascript" src="<?php bloginfo( 'template_directory' );?>/js/bgstretcher.js"></script>
   
       <script type="text/javascript" src="<?php bloginfo( 'template_directory' );?>/js/background.js"></script>
       ```
   
 * I can see that jQuery is loaded: `wp-includes/js/jquery/jquery.js?ver=1.4.2'>
   </script>`
 * But my script doesn’t work and then if I add `<script type="text/javascript" 
   src="<?php bloginfo( 'template_directory' );?>/js/jquery-1.4.2.min.js"></script
   >`
    the script will work but that mean i don’t need to use function init_jquery()
   to load it!
 * How i should load jQuery with TwentyTen?
 * Regards

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

 *  [Chinmoy](https://wordpress.org/support/users/chinmoy/)
 * (@chinmoy)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/jquery-load-problem/#post-1866962)
 * try this once
 *     ```
       <?php
       	/* We add some JavaScript to pages with the comment form
       	 * to support sites with threaded comments (when in use).
       	 */
       	if ( is_singular() && get_option( 'thread_comments' ) )
       		wp_enqueue_script( 'comment-reply' );
   
       	/* Always have wp_head() just before the closing </head>
       	 * tag of your theme, or you will break many plugins, which
       	 * generally use this hook to add elements to <head> such
       	 * as styles, scripts, and meta tags.
       	 */
   
               wp_enqueue_script('jquery');
   
       	wp_head();
       ?>
       ```
   
 *  Thread Starter [designrf](https://wordpress.org/support/users/designrf/)
 * (@designrf)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/jquery-load-problem/#post-1866964)
 * Thanks but it doesn’t work 🙁
 *  Thread Starter [designrf](https://wordpress.org/support/users/designrf/)
 * (@designrf)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/jquery-load-problem/#post-1866968)
 * It looks like i found my problem.
    I forgot the $ in the function($)
 * jQuery(document).ready(function($){
    //script here });
 *  [Chinmoy](https://wordpress.org/support/users/chinmoy/)
 * (@chinmoy)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/jquery-load-problem/#post-1866969)
 * have jquery-1.4.2.min.js file in your theme’s js folder?
 *  Thread Starter [designrf](https://wordpress.org/support/users/designrf/)
 * (@designrf)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/jquery-load-problem/#post-1867071)
 * Well it was just to try with different library if the issue was from the library
   version.

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

The topic ‘Jquery Load Problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [designrf](https://wordpress.org/support/users/designrf/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/jquery-load-problem/#post-1867071)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
