我花了两天时间在这个插件上,但是没有成功-只在本地数据数组上工作:( 我有一个代码(django/python)可以生成json字符串(valid-tested on http://jsonlint.com/),如下所示:
[{"id": 7626, "value": "Jaros\u0142aw", "label": "Adrianowicz"}, {"id": 2702, "value": "Bo\u017cena", "label": "Baranowicz"}, {"id": 2542, "value": "Tomasz", "label": "Baranowicz"}]
我的jquery代码是:
^{pr2}$我检查了ajax示例-geonames-这个工作正常。有什么帮助吗?在
您可以在autocomplete中使用任何.ajax选项。试试这个
对于source的值,您可以使用回调而不是页面的url,如下例所示:
http://jqueryui.com/demos/autocomplete/#remote-with-cache
使用回调允许您为.ajax编写自己的成功和错误处理。您可能希望使用.ajax并检查错误。在
相关问题 更多 >
编程相关推荐