Only jquery autocomplete download

只愿长相守 提交于 2020-05-27 05:08:25

问题


I want to download jquery autocomplete plugin, but it doesn't let me download only that file but with jquery core, jquery position, widget etc. scripts. But I don't want all these files as I already have them added in my project and working fine, so I don't want to break any current working logic.

When I tried putting all the script came with autocomplete(including core.js), it worked but then my datepicker stopped working.

I also tried picking and adding only autocomplete script part from the full script but it didn't work, may be because I am using jquery 1.7.2 and I found autocomplete 1.10.2.

Is there any way to get only autocomplete plugin or any similar plugin that can work something like we get other plugins from outside authors?

Basically my requirement is not exactly of autocomplete, what I want is to have a text box that on focus show the list of options to choose, something like dropdownlist options but also lets us put our own value and don't show the dropdown list arrow. I made this all working with the help of autocomplete plugin, the problem came when I tried adding it in my project.

Basically this requirement

enter image description here

Any idea what I can do?


回答1:


You can go to the All jQuery UI Downloads page and get the file with the source.

Then, in the ui folder, you will see separate files for each module, including jquery.ui.autocomplete.js.

I do not know how your files are organized in your project, but be aware that the autocomplete module needs core, widget, position and menu in order to work. The first two must be loaded before autocomplete.

Your code should look like this:

<script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.core.js"></script>
<script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.widget.js"></script>
<script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.position.js"></script>
<script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.menu.js"></script>
<script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.autocomplete.js"></script>

Hope it helps!



来源:https://stackoverflow.com/questions/15539107/only-jquery-autocomplete-download

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!