Hello! I do not understand what the problem is. JS and autocomplit library is connected.

<link id="bs-css" href="css/bootstrap-cerulean.min.css" rel="stylesheet"> <link href="css/charisma-app.css" rel="stylesheet"> <link href='bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css' rel='stylesheet'> <link rel="stylesheet" href="bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" /> <link href='bower_components/chosen/chosen.min.css' rel='stylesheet'> <link rel="stylesheet" href="js/autocomplete/jquery.auto-complete.css"> <script src="bower_components/jquery/jquery.js"></script> 

In the head tag;

 <script type="text/javascript" src="js/autocomplete/jquery.auto-complete.js"></script> <script type="text/javascript" src="moment/moment-with-locales.min.js"></script> <script type="text/javascript" src="bower_components/moment2/moment.min.js"></script> <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="bower_components/bootstrap-tour/build/js/bootstrap-tour.min.js"></script> <script type="text/javascript" src="bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script> <script type="text/javascript" src="php/admPan/admPan.js"></script> 

And before in the script admPan.js lies

 $("#cityTK").autoсomplete({}) 

Error loading page

 Uncaught TypeError: $(...).autoсomplete is not a function 

I do not understand what exactly is wrong. How to fix? Or am I connecting something wrong?

UPD: Forgot to add 1 more library.

 <script src="bower_components/chosen/chosen.jquery.min.js"></script> 

It is also connected before the closing body

  • Are you sure that you connected jquery.js before calling jquery.auto-complete.js? - Arsen
  • Well, in fact, jq connects to the head. And jquery.auto-complete.js before </ body> - Alexey
  • Therefore jq should connect before - Alex
  • Well, if you are sure that the jquery.js and jquery.auto-complete.js files are correct libraries, then you may have some kind of conflict. To check, remove the connection of other JS and leave only jquery and autocomplete - Arsen
  • Disconnected everything except these two files. Did not help. Then you should look for other versions of jq and autocomplete? - Alexey

1 answer 1

Redid the page by example. From jqueryui.com/autocomplete I did not find which of the libraries produced a conflict. I connected everything back gradually - everything works.

  • To supplement your question, we ask you to use the edit option. The “Post Reply” button should only be used for comprehensive answers to questions. - From the queue of checks - Air
  • one
    The answer to the question must be some kind? I answered my question. - Aleksey
  • “Well, I went through something there, I don’t know what the problem was, but it worked.” It doesn’t fit the useful answer. - yolosora
  • one
    I agree. But there is no other. And to understand what exactly was the case is also not an option. And leaving the question without an answer is also not an option, so that the answers are simply not written. - Alexey