相关疑难解决方法(0)

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];
                }
            );
       ..
Run Code Online (Sandbox Code Playgroud)

我需要更改什么来将其转换为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];
                }
            );
       ..
Run Code Online (Sandbox Code Playgroud)

我将等待" 添加远程源支持预先输入 "问题得到解决.

jquery jquery-autocomplete jquery-ui-autocomplete twitter-bootstrap typeahead.js

277
推荐指数
6
解决办法
30万
查看次数