Title: loading script
Last modified: August 22, 2016

---

# loading script

 *  [timholz](https://wordpress.org/support/users/timholz/)
 * (@timholz)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/loading-script/)
 * Hi
    I could successfully load a script in a theme, that i built from scratch.
   Here is the procedure in functions.php:
 *     ```
       //scripts for animation//
       function anim_scripts() {
   
           if( is_page(array('28','45'))) { //
       			wp_enqueue_script( // Load up my script
                   'bganim',
                   get_stylesheet_directory_uri() . '/js/bganim.js',
                   array('jquery')
               ); // End of enqueue
   
           } // End is
       } //
       add_action('wp_enqueue_scripts', 'anim_scripts');
       ```
   
 * When i do the same thing in a child of 2013, i get an error in the console: something
   like «$ is not a function».
 * Why is that?
    Does anyone have an idea, why this error comes up with the child
   of 2013 and not with my own theme?
 * Thanks for your time and interest.
 * regards
    theo

Viewing 1 replies (of 1 total)

 *  Thread Starter [timholz](https://wordpress.org/support/users/timholz/)
 * (@timholz)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/loading-script/#post-5168498)
 * Hi
    I found an article on this issue. Here is the link: [http://www.pauljoyceuk.com/codex/2011/jquery-is-not-a-function/](http://www.pauljoyceuk.com/codex/2011/jquery-is-not-a-function/)
 * I simply replaced «$» with «jQuery».
 * Good luck to you all.
    theo

Viewing 1 replies (of 1 total)

The topic ‘loading script’ is closed to new replies.

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [timholz](https://wordpress.org/support/users/timholz/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/loading-script/#post-5168498)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
