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
$('header').find('a[href="'+window.location.hash+'"]');

// was instead

$('a[href*=#]').bind("click", function(e){
// and 
$('header').find('a[href='+window.location.hash+']');

// 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:

spoopy

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

John Hartley is a Director of Product Engineering at Beam Dental in Columbus, OH. With 5+ 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

0
Would love your thoughts, please comment.x
()
x