擅长:python、mysql、java
<p>您的JSON应该如下所示:</p>
<pre><code>[
{
"id":"Ficedula hypoleuca",
"label":"Eurasian Pied Flycatcher",
"value":"Eurasian Pied Flycatcher"
},
{
"id":"Muscicapa striata",
"label":"Spotted Flycatcher",
"value":"Spotted Flycatcher"
}
]
</code></pre>
<p>当您查看<a href="http://jqueryui.com/autocomplete/#multiple-remote" rel="nofollow">http://jqueryui.com/autocomplete/#multiple-remote</a>处的示例时,您可以看到自动完成是“询问”<code>http://jqueryui.com/resources/demos/autocomplete/search.php</code></p>
<p>您还应该使用<code>/api/get_employees/</code>,而不是<code>api/get_employees/</code></p>
<p>也许这也很重要(对于你的django部分):
jquery使用参数术语to作为搜索词。
例如<a href="http://jqueryui.com/resources/demos/autocomplete/search.php" rel="nofollow">http://jqueryui.com/resources/demos/autocomplete/search.php</a>?<strong>term=ca</strong>正在搜索“ca”</p>