jquery - Unexpected Token Illegal for an array -


i cannot figure out why getting error chrome's developer tool. following line:

var accessoriescats = [ “beaded accessories”, “cufflinks”, “flip flops”, “floral accessories”, “foot jewelry”, “hair accessories”, “hankies”, “jewelry”, “leg garters”, “purses”, “shoe stickers”, “something blue”, “tiaras”, “totes” ]; 

comes error:

uncaught syntaxerror: unexpected token illegal.

i'm not sure if indeed line problem, or else.

here entire code:

<script>     if (window.location.href.indexof("category-s/2022.htm") != -1) {             var accessoriescats = [ “beaded accessories”, “cufflinks”, “flip flops”, “floral accessories”, “foot jewelry”, “hair accessories”, “hankies”, “jewelry”, “leg garters”, “purses”, “shoe stickers”, “something blue”, “tiaras”, “totes” ];                 $('#content_area > table:nth-child(6) > tbody > tr > td > table:nth-child(1) > tbody > tr > td > table > tbody').find('a').each(accessoriescats, function(){                             $(this).append('<span class="promo__text”>”+accessoriescats+”</span>');                             $(this).removeclass('smalltext colors_text').addclass('subcatrollover');             });     } </script> 

you have used bad quotes, use " or ' instead of , :

var accessoriescats = [ "beaded accessories", "cufflinks", "flip flops", "floral accessories", "foot jewelry", "hair accessories", "hankies", "jewelry", "leg garters", "purses", "shoe stickers", "something blue", "tiaras", "totes" ]; 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -