自动完成不起作用我想从mysql数据库(如google option)中获取数据我的文件不起作用,当我们从摘要选项中按下选择数据时不显示任何东西 <!DOCTYPE html> <html> <head> <title></title> <!--my file not working auto complete address from database--> <!--code inclide file of botstarp --><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.2/bootstrap3-typeahead.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> <!--code of auto fetch--> <script> $(document).ready(function () { $('#Country').typeahead({ source: function (query, result) { $.ajax({ url:"autoselect_jquery5.php", data:'query=' + query, dataType:"json", type:"POST", success: function (data) { result($.map(data, function (item) { return item; })); } }); } }); }); </script> </head> <body> div class="container" style="width:600px;"> <h2 align="center">Autocomplete Textbox using Bootstrap Typeahead with Ajax PHP</h2> <label>Search Country</label> <input type="text"name="country"id="country"autocomplete="off"placeholder="Country" /> </div> </body> < /html>
1 回答
- 1 回答
- 0 关注
- 142 浏览
添加回答
举报
0/150
提交
取消