1, the body inside the content
<input type= "text" class= "Inputtxt" id= "Txtjigou" autocomplete= "Off"/>
2. Introduction of Jquery.ui.min.js and his style
The 3.js code is as follows <script type= "Text/javascript" >
$ (function () {$ ("#txtJigou"). AutoComplete ({source:function (request, response) {$.aja X ({URL: "/home/organization/getlist.html", DataType: "JSON", Data: {"name": "Medium", "typeID": "11"}, Success:function (data1) {if (data1.state==1) {//data1 return Back to JSON format as follows response (Data1.data); } } }); }, Minlength:1, Autofocus:true, Focus:function (event, UI) {$ ("#txtJigou" ). Val (Ui.item.company); return false; }, Select:function (event, UI) {$ ("#txtJigou"). Val (Ui.item.company); return false; }}). AutocOmplete ("instance"). _renderitem = function (UL, item) {
Here is the custom display of the data that I need to display the data is above the Data1.data return $ ("<li>"). Append ("<a>" + Item.company + "<br>" + Item.desc + "</a>"). APPENDTO (UL); };}); </script>
4. Return the JSON data as follows
{ "state": 1, "data": { "10013": { "id": "10013", "Company": "Golden Valley Trust", "Alias": " China Golden Valley International Trust Co., Ltd. " }, " 11031 ": { " id ":" 11036 ", " Company ":" Minsheng Trust ", " Alias ":" China Minsheng Trust Company Limited " } }}