Twitter Typeahead:使用相同的功能升级到最新版本

时间:2014-01-09 21:15:29

标签: javascript twitter-bootstrap twitter-typeahead

我目前正在使用Bootstrap-typeahead插件,这样:

$('.patients_typeahead').typeahead({
                    name: 'patientshomepage',
                    source: function (query, process) {
                        $.ajax({
                            url: 'source.php',
                            type: 'POST',
                            query: 'query=' + query,
                            dataType: 'JSON',
                            async: true,
                            success: function (data) {
                               process(data);
                            }

                        })
                    }



                });

我想升级到最新的typeahead,但我明白不再支持source: function()了。如何转换我的代码以便我可以使用最新的twitter-typeahead?

0 个答案:

没有答案