Asp.net mvc 4 bootstrap 3 typeahead不会显示结果
我试图在MVC4中实现typeahead (我包括了typeahead js和css。) 我使用这个ajax方法来获取列表Asp.net mvc 4 bootstrap 3 typeahead不会显示结果,asp.net-mvc-4,twitter-bootstrap,Asp.net Mvc 4,Twitter Bootstrap,我试图在MVC4中实现typeahead (我包括了typeahead js和css。) 我使用这个ajax方法来获取列表 $(function() { // get your list $.getJSON('/Main/GetServiceNames', function (allData) { $('#servicename').typeahead({source: allData}); }); });
$(function() {
// get your list
$.getJSON('/Main/GetServiceNames', function (allData) {
$('#servicename').typeahead({source: allData});
});
});
这是ajax请求的结果:
["RetrieveDocument","PublishDocument","PublishFeedback","PublishSurvey","RetrievePartner","RetrieveLabelDocuments","RPCRetrieveZipCode","ESB2InfraService","PublishTest","PublishPolcy"]
但由于某些原因,结果不会绑定到#servicenameHtml输入这是我试图绑定到的html,并且没有显示任何列表
<input type="text" class="form-control" placeholder="servicename" id="servicename" data-provide="typeahead">
编辑:
我设法在这里创建了相同的错误
谢谢
miki看看这个例子。另外,请记住,Bootstra的typeahead.js不同于Twitter的typeahead.js,我认为您正在使用它。您可以获得Bootstrap的typeahead.js。I尽管在Bootstrap 3中删除了typeahead插件。。?我自己添加了typeahead.js,并将typeahead css添加到