jquery error in chrome console

Hi,

I have have the following error appear in the console in chrome developer tools that im not sure how to get rid of.

Uncaught Error: Syntax error, unrecognized expression: ul (li.page_item):has(ul.children)

Was wondering if you could help get rid of this?

Thanks,
Andy6350Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Post a link to your page so Experts can take a look at everything.
0
unknown_routineCommented:
It won't be easy to explain the  error without seeing you code  but
 1 reason could not you are not putting $ before variables that have a  jQuery object.
0
Andy6350Author Commented:
Sorry yes forgot the link :)

www.thesportsinjuryclinic.org
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Before you start looking at your js/jquery, look at these few errors in coding.  Fixing these may do the trick. http://validator.w3.org/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
The problem is in this code here
     <script type="text/javascript">
	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;
            });
          });
	}
      </script> 

Open in new window

What are you actually trying to do with this code? Because it looks like you might be able to achieve the same result with CSS.
0
Andy6350Author Commented:
I didn't actually put that code in, unless its from a plugin?
0
Chris StanyonWebDevCommented:
It looks like you're trying to remove the link info from all the A tags in the submenus (with a class of 'children') when you hover over them - can't think of a single reason why you'd do that, so maybe explain exactly what you're trying to achieve.

I'm guessing you want the link info removed from the parent, in which case you'll need something like this:

$('li.page_item').each(function() {
	if ($(this).has('ul').length) {
		$(this).children('a')
			.removeAttr('href')
			.css('cursor', 'default')
			.click(function (e) {
				e.preventDefault();
			});
	};
});

Open in new window

0
Andy6350Author Commented:
Hi,

Thanks for your advice, i fixed all the errors and the issue seemed to be something to do with a plugin that i actually no longer needed, so i deactivated and removed it.

Thanks for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.