本节主要介绍自动完成插件 - jQuery-Autocomplete, 插件地址:https://github.com/devbridge/jQuery-Autocomplete
<script src="BJUI/plugins/jquery-autocomplete/jquery.autocomplete.min.js"></script>
<div data-filter="autoComplete"> <input type="text" value="" placeholder="输入你好" name="tag"> </div>
(function () { const $box = $.CurrentNavtab $box.find('input[name="tag"]').autocomplete({ serviceUrl: 'ajax/tags.json', appendTo: $box.findFilter('autoComplete') }) }())
{"suggestions": ["你好", "BJUI", "测试"]}