Something is a miss here I cannot get rid of the error: If is not defined.
I am working with new array (Routearr) , and new field (routes). To try and fix the error I added a check to see if array is empty (!=null) I also added a ; after the if statement but nothing.. is there anything missing from you original code?
codeRoutearr = new Array();
$(data).each(function(){
If ($(this)[0].routes !=null); { // Not Null Check
Routearr.push($(this)[0].routes);
localStorage.setItem("route_keyword", JSON.stringify(Routearr));
Appery("RouteNumber_textinput").autocomplete({source: Routearr});
}
}); /code