Goodnight! I'm trying to figure out how jQuery works, but I can't properly configure it on the jsp page. On the html page, the code works fine. Please tell me what could be the problem?

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jQuery UI</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.10.3/jquery-ui.min.js"></script> <link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.3/themes/sunny/jquery-ui.css"> <script type="text/javascript"> $(function() { var flowers = ["Астра", "Нарцисс", "Роза", "Пион", "Примула", "Подснежник", "Мак", "Первоцвет", "Петуния", "Фиалка"]; $('#acInput').autocomplete({ source: flowers }) }); </script> </head> <body> <form> <div class="ui-widget"> <label for="acInput">Выберите название цветка: </label> <input id="acInput"/> </div> </form> </body> </html> 

  • Does your jsp page generate exactly the same code as you provided? - br3t
  • Did not quite understand the question. I am creating a jsp page with the code above. The browser displays an input field but auto substitution does not work. - Leonid Dubravsky
  • Ok, what do you see in the browser console? Try connecting libraries by adding http:// at the beginning. - br3t
  • Oh miracle :) it worked. http helped, although I previously tried https. Where is the correct answer? Can you tell me if I have no word in the list, can I submit it for processing? - Leonid Dubravsky
  • Added answer. The word not from the list can be transferred for processing, autocomplete only complements your words as you type, it does not affect the transfer of parameters to the server. - br3t

1 answer 1

Try connecting libraries by adding http:// at the beginning.