Javascript Array Indexof Is Not Defined In Jquery