仅jQuery自动完成下载 [英] Only jquery autocomplete download

查看:92
本文介绍了仅jQuery自动完成下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想下载jquery自动完成插件,但它不允许我仅下载该文件,而是使用jquery核心,jquery位置,小部件等脚本. 但是我不想要所有这些文件,因为我已经将它们添加到项目中并且可以正常工作,所以我不想破坏任何当前的工作逻辑.

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.

当我尝试使所有脚本都带有自动完成功能(包括core.js)时,它可以工作,但是我的日期选择器停止工作了.

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

我还尝试从完整脚本中仅选择并添加自动完成脚本部分,但这没有用,可能是因为我使用的是jquery 1.7.2并发现自动完成1.10.2.

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?

基本上我的要求不是完全自动完成,我想要的是让一个文本框突出显示要选择的选项列表,例如dropdownlist选项,但也让我们放下自己的价值而不显示下拉列表箭头. 我在自动完成插件的帮助下完成了所有工作,当我尝试将其添加到项目中时出现了问题.

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.

基本上是这个要求

知道我能做什么吗?

推荐答案

您可以转到所有jQuery UI下载页并获取带有源文件.

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

然后,在ui文件夹中,您将看到每个模块的单独文件,包括jquery.ui.autocomplete.js.

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

我不知道您的文件在项目中的组织方式,但是要知道autocomplete模块需要corewidgetpositionmenu才能正常工作.前两个必须在autocomplete之前加载.

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.

您的代码应如下所示:

<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>

希望有帮助!

这篇关于仅jQuery自动完成下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆