0

mvc 4で先行入力を実装しようとしています。

(typeahead js と css を含めました。)

リストを取得するためにこのajaxメソッドを使用しています

$(function() {
         // get your list
         $.getJSON('/Main/GetServiceNames', function (allData) {
             $('#servicename').typeahead({source: allData});
         });
     });

これは ajax リクエストの結果です:

["RetrieveDocument","PublishDocument","PublishFeedback","PublishSurvey","RetrievePartner","RetrieveLabelDocuments","RPCRetrieveZipCode","ESB2InfraService","PublishTest","PublishPolcy"]

しかし、何らかの理由で、結果が#servicename Html 入力
にバインドされません。これは、バインドしようとしている html であり、リストのどれも表示されません。

     <input type="text" class="form-control" placeholder="servicename" id="servicename" data-provide="typeahead"> 

編集:私はここで同じエラーを作成することができまし

ありがとう

ミキ

4

1 に答える 1