使用Ajax自动完成。 jQuery插件或jQuery用户界面控件? [英] autocomplete with ajax. jQuery plugin or jQuery UI widget?

查看:108
本文介绍了使用Ajax自动完成。 jQuery插件或jQuery用户界面控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我得到它的权利,有jQuery的自动完成插件和jQuery UI自动完成构件之间的差异。哪一个更好,你建议使用?我支持第二个,但我不知道。

If I get it right, there is a difference between jQuery autocomplete plugin and jQuery UI autocomplete widget. Which one is better and you suggest to use? I'm rooting for the second one, but I'm not sure.

您还可以点我到了一些简单的code片段。基本上,我需要从一个操作方法得到的值。

Can you also point me to a few sample code snippets. Basically I need to get the values from an action method.

推荐答案

由于jQuery的自动完成插件的主页(我相信你的意思的这个),该插件已经赞成pcated为jQueryUI的自动完成插件去$ p $:

As stated on the jQuery autocomplete plugin home page (I believe you mean this one), the plugin has been deprecated in favor for the jQueryUI autocomplete plugin:

请注意(2010-06-23):该插件是德precated以及未制订
  了。 它的继任者是jQuery用户界面的一部分,而这个迁移指南
  介绍了如何从这个插件的新一送。

Note (2010-06-23): This plugin is deprecated and not developed anymore. Its successor is part of jQuery UI, and this migration guide explains how to get from this plugin to the new one.

(重点煤矿)

考虑到这一点,我会建议与jQueryUI的产品继续向前发展。

With that in mind, I would recommend proceeding forward with the jQueryUI offering.

我还要补充一点,自动完成构件是非常可扩展性和强大的(一些插件的网页上所提供的 例子是深入pretty)。再加上你频繁的更新和在计算器上良好的支持。

I would also add that the autocomplete widget is very extensible and robust (some of the examples provided on the plugin's page are pretty in-depth). Plus you get the added benefit of frequent updates and good support on StackOverflow

对于从操作方法得到的值,这将肯定是不可能的。随着jQueryUI的小部件,你会写是这样的:

As for getting values from an action method, that would definitely be possible. With the jQueryUI widget you would write something like:

$( "#selector" ).autocomplete({
    source: "/path_to_your_action",
});

查看远程数据源例如以获取更多信息。

这篇关于使用Ajax自动完成。 jQuery插件或jQuery用户界面控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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