twitter bootstrap typeahead ajax示例
我试图找到一个twitter bootstrap typeahead元素的工作示例,该元素将进行ajax调用以填充它的下拉列表。
我有一个现有的工作jquery自动完成示例,它定义了ajax url以及如何处理回复
<script type="text/javascript">//<![CDATA[
$(document).ready(function() {
var options = { minChars:3, max:20 };
$("#runnerquery").autocomplete('./index/runnerfilter/format/html',options).result(
function(event, data, formatted)
{
window.location = "./runner/index/id/"+data[1];
}
);
..我需要更改什么来将其转换为typeahead示例?
<script type="text/javascript">//<![CDATA[
$(document).ready(function() {
var options = { source:'/index/runnerfilter/format/html', items:5 };
$("#runnerquery").typeahead(options).result(
function(event, data, formatted)
{
window.location = "./runner/index/id/"+data[1];
}
);
..我将等待“ 添加远程源支持预先输入 ”问题得到解决。
侃侃无极
慕的地8271018
BIG阳
随时随地看视频慕课网APP
相关分类