I am using jQuery 1.11.2 and trying to get an autocomplete widget to parse a data array. I have people in the array, Will Smith and Willem Dafo. I expected both names to be added to the drop-down list when I type Wi in the text box, but I don't get the answer. Here is a copy of the code:
<script src="js/jquery/jquery-1.11.2.js"></script> <script src="js/jquery/jquery-ui.js"></script> <link rel="stylesheet" href="js/jquery/jquery-ui.css"/> <link rel="stylesheet" href="js/jquery/jquery-ui.theme.css"/> <script type="text/javascript"> $(function() { var data = [ { "id": 1, "first_name": "Will", "last_name": "Smith", "created_at": "2015-01-27T13:09:20.243Z", "updated_at": "2015-01-27T13:09:20.243Z" }, { "id": 2, "first_name": "Willem", "last_name": "Dafoe", "created_at": "2015-01-27T13:17:23.479Z", "updated_at": "2015-01-27T13:17:23.479Z" } ]; </script> Search: <input type="text" id="search" />
The code is in the same html folder on the local drive. At the moment, the server is not involved. In addition, I checked the tool for checking for errors, but none are displayed, and all resources are found and loaded.
javascript jquery jquery-ui jquery-ui-autocomplete
Darc nawg
source share