troubleshooting Question

Code is working but keep getting console error, should I ignore?

Avatar of Aaron Roessler
Aaron Roessler asked on
jQueryWordPress
5 Comments1 Solution65 ViewsLast Modified:
My code is working but i get a console error: Should I ignore it?
Uncaught Error: Syntax error, unrecognized expression: #lips/

URL is https://allgood.flywheelsites.com/shop/#lips/

Here is my code: the trailing slash was breaking this code but i finally got it working.
var url = window.location.href.replace(/\/$/, '');
var lastPart = url.substr(url.lastIndexOf('/') + 1);
if (lastPart === "#lips") {
jQuery('input.jet-checkboxes-list__input').each(function(){
var catagory_value=jQuery(this).val();      
for (var i=0;i<catagory_value[0].length;i++) {
if (catagory_value == "129") {
jQuery(this).parent().addClass("lips");
jQuery(window).load(function() {
      jQuery('.lips .jet-checkboxes-list__input').trigger('click');
});
} } }); }
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros