0
2つのJSONファイルをマージしてオートコンプリートプラグインで使用しようとしています。2つのjsonファイルをマージしてオートポッププラグインで使用する
しかし、私は自動完了とjqueryの両方に対してjsライブラリを追加したとしてもエラーTypeError: $(...).easyAutocomplete is not a function
を取得します。
私のコードは次のようになります。
<script src="jquery-3.1.0.js"></script>
<link href="easy-autocomplete.min.css" rel="stylesheet" />
<script src="jquery.easy-autocomplete.min.js"></script>
<script>
$.getJSON("file1.json", function (data1) {
$.getJSON("file2.json", function (data2) {
var final = $.extend({}, data1, data2);
var options = {
data: final,
getValue: "name",
list: {
match: {
enabled: true
}
},
theme: "square"
};
$("#KUNDE").easyAutocomplete(options); $('div.easy-autocomplete').removeAttr('style');
});
});
</script>
これは私には小さな変更が加えられています。代わりにfinal.push(data1.employees1); final.push(data2.employees2); –
final.push(data1); final.push(data2); –
ありがとうございました:) –