以下作品:
$("#txtAllowSearch").autocomplete(
{ source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"] }
);
但以下不起作用:
var $local_source = '["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]';
$("#txtAllowSearch").autocomplete(
{ source: $local_source }
);
我不擅长数组。