• Resolved ljkeashly

    (@ljkeashly)


    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)
  • 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

    (@ljkeashly)

    Hi,

    Thank you for your repsonse. It turns out it was the “Disable Parent Menu Link” plugin that was adding the code.

    Thanks again.

    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.