jQuery-tokeninput failing: “term” is undefined?
问题 In my rails application I am trying to use jquery-tokeninput. I have everything working - json response and all - but the script errors out when anything is typed into the tokenized field, complaining: TypeError: term is undefined --> return term.replace(regexp_special_chars, '\\$&'); Both jQuery as well as the tokeninput scripts are loaded. What could cause this? 回答1: It sounds like you might need to specify propertyToSearch. By default, Tokeninput looks for a "name" field, but if you don't