Title: wp_head() causes javascript errors.
Last modified: August 19, 2016

---

# wp_head() causes javascript errors.

 *  [teddyknox](https://wordpress.org/support/users/teddyknox/)
 * (@teddyknox)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/wp_head-causes-javascript-errors/)
 * Hi,
    On my blog I have a javascript slider, which I wrote with mootools. It worked
   when wp_head() was commented out, but now that I want to use the next gen gallery
   plugin, I need to uncomment it. And so, when I load my page now, many mootools
   errors come up and the javascript slider doesn’t work, but the flash nextgen 
   gallery does. Does anybody have any idea why wp_head() would have an adverse 
   effect on the javascript? Thankyou!

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

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/wp_head-causes-javascript-errors/#post-1299761)
 * > Does anybody have any idea why wp_head() would have an adverse effect on the
   > javascript?
 * Because its loading bad javascript. By itself, [wp_head()](http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head)
   doesn’t do much of anything. What it does do is load code into the `<head>` section
   of the document _if_ told to do so. The problem isn’t with wp_head(), its with
   something that wp_head has been told to load. Exactly what its loading I can’t
   tell from the information you’ve given. An URL would help though.
 *  Thread Starter [teddyknox](https://wordpress.org/support/users/teddyknox/)
 * (@teddyknox)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/wp_head-causes-javascript-errors/#post-1299954)
 * Thanks,
 * [http://www.theblackandwhite.net](http://www.theblackandwhite.net)
 *  [Jared Atchison](https://wordpress.org/support/users/jaredatch/)
 * (@jaredatch)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/wp_head-causes-javascript-errors/#post-1299960)
 * Works for me with no errors – FF 3.5 Mac
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/wp_head-causes-javascript-errors/#post-1299962)
 * Several different javascript files are triggering errors. Disable all of the 
   scripts then start putting them back one by one making sure things work before
   moving on. It would help a lot if you get Firefox, install Firebug, load the 
   page, and enable Firebug for the page.
 *  [Gerald Yeo](https://wordpress.org/support/users/geraldyeo/)
 * (@geraldyeo)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/wp_head-causes-javascript-errors/#post-1299978)
 * A guess would be that since next gen gallery loads jQuery. With MooTools loaded,
   it may cause a conflict in the usage of $, even though jQuery is set to no-conflict.
 * Try switching the $ sign in your MooTools dependent JavaScript with document.
   id
 * This is to trigger MooTools’ Dollar Safe Mode.
    [http://mootools.net/blog/2009/06/22/the-dollar-safe-mode/](http://mootools.net/blog/2009/06/22/the-dollar-safe-mode/)

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

The topic ‘wp_head() causes javascript errors.’ is closed to new replies.

 * 5 replies
 * 4 participants
 * Last reply from: [Gerald Yeo](https://wordpress.org/support/users/geraldyeo/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/wp_head-causes-javascript-errors/#post-1299978)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
