Title: JS error in theme
Last modified: August 21, 2016

---

# JS error in theme

 *  Resolved [ljkeashly](https://wordpress.org/support/users/ljkeashly/)
 * (@ljkeashly)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/js-error-in-theme/)
 * Hi,
 * We are using the-bootstrap and are having an issue where code is inserted into
   the page in the footer area by wp_footer() call which has a JS error.
 * This is the code that gets inserted:
 *     ```
       if (jQuery("ul (li.page_item):has(ul.children)").length > 0) {
       	  jQuery("ul (li.page_item):has(ul.children)").hover(function () {
                   jQuery(this).children("a").removeAttr('href');
                   jQuery(this).children("a").css('cursor', 'default');
                   jQuery(this).children("a").click(function () {
                     return false;
                   });
                 });
        	}
       	else if (jQuery("ul (li.menu-item):has(ul.sub-menu)").length > 0) {
                 jQuery("ul (li.menu-item):has(ul.sub-menu)").hover(function () {
                   jQuery(this).children("a").removeAttr('href');
                   jQuery(this).children("a").css('cursor', 'default');
                   jQuery(this).children("a").click(function () {
                     return false;
                   });
                 });
       	}
       ```
   
 * If I comment out wp_footer() in footer.php, then this code goes away.
 * When that code is in the template we get the following JS error:
    Error: Syntax
   error, unrecognized expression: ul (li.page_item):has(ul.children)
 * Does anyone know why this code is being inserted, by what and where?
 * Thank you.

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

 *  [Brian Harris](https://wordpress.org/support/users/zgani/)
 * (@zgani)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/js-error-in-theme/#post-4533104)
 * That code does not seem to be from the theme.
 * Have you checked your plugins? Also test the site with the default theme to see
   if the error stays or disappears.
 * A link to the site would be of help in assisting you further if the issue persists.
 *  Thread Starter [ljkeashly](https://wordpress.org/support/users/ljkeashly/)
 * (@ljkeashly)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/js-error-in-theme/#post-4533112)
 * Hi,
 * Thank you for your repsonse. It turns out it was the “Disable Parent Menu Link”
   plugin that was adding the code.
 * Thanks again.
 *  [Brian Harris](https://wordpress.org/support/users/zgani/)
 * (@zgani)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/js-error-in-theme/#post-4533118)
 * You are welcome.
 * Don’t forget to mark the thread as resolved.

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

The topic ‘JS error in theme’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/the-bootstrap/2.0.3/screenshot.
   png)
 * The Bootstrap
 * [Support Threads](https://wordpress.org/support/theme/the-bootstrap/)
 * [Active Topics](https://wordpress.org/support/theme/the-bootstrap/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/the-bootstrap/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/the-bootstrap/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Brian Harris](https://wordpress.org/support/users/zgani/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/js-error-in-theme/#post-4533118)
 * Status: resolved