Syntax error, unrecognized expression:

Best thing to do when you see this is check what expression is unrecognized. For me it was a[href=]. After looking into the WordPress theme files it turned out that for some unknown reason the theme developers had not included quotes around the actual href. So what should have been:

$('a[href*="#"]').bind("click", function(e){
// or

// was instead

$('a[href*=#]').bind("click", function(e){
// and 

// no need for "" trolololololololol

It was also one of those developer miracles where you try something and it works the first time, which makes you question whether there was ever a problem to begin with. It is October after all. This is the time of the year where spooky code bugs pop up and disappear just to mess with developers. No? Hasn’t happened to you? Just wait. The <poltergeists> are out there.

Links that helped:


Notify of
Inline Feedbacks
View all comments

John Hartley is a Director of Product Engineering at Beam Dental in Columbus, OH. With 7+ years of leadership experience he has worked in startups, agencies, and began his career as a freelance Front End Developer. Always looking to iterate, this blog is a place for him to share his knowledge as well as hone his craft, challenge assumptions, and build a strong base of leadership and management knowledge. Connect with him on LinkedIn

Would love your thoughts, please comment.x