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
Post a Comment