是否有不止一个 jQuery 自动完成小部件? [英] Is there more than one jQuery Autocomplete widget?

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

问题描述

我认为只有一个 - 包含在 jQuery UI 和 此处记录.

I thought there was only one - included in jQuery UI and documented here.

我知道有第三方自动完成小部件可以插入 jQuery,例如 一个来自 devbridge.但我会将其描述为jQuery 自动完成小部件,而不是jQuery 自动完成小部件.

I know there are third-party autocomplete widgets that plug-in to jQuery, like the one from devbridge. But I would describe that as an autocomplete widget for jQuery, rather than the jQuery autocomplete widget.

但在 Stackoverflow 上,我看到有关自动完成小部件的问题,该小部件不使用 jQuery 中描述的语法用户界面文档.例如:

But on Stackoverflow, I see questions asking about an autocomplete widget that does not use the syntax described in the jQuery UI documentation. For example:

jQuery UI 语法如下所示:

The jQuery UI syntax looks like this:

      $("#input1").autocomplete({
          source: function(req, responseFn) {
                ...
          },

          select: function(value, data){
                 ...
          }
      });

而其他一些问题的语法如下:

Whereas some of those other questions hae a syntax like this:

  $("#city").autocomplete("CUList.asmx/GetCUList", { 
      dataType: 'jsonp', 
      parse: function(data)  
      { 
          var rows = new Array(); 
          for(var i=0; i<data.length; i++){ 
              rows[i] = { data:data[i], value:data[i].CUName, result:data[i].CUName }; 
          } 
          return rows; 
      }, 
      formatItem: function(row, i, n) { 
          return row.CUName + ', ' + row.CUCity; 
      }, 
      max: 50 
  });  

差异的解释是什么?人们在询问jquery 自动完成"时没有指定哪个.没有方向,我不应该假设 jquery UI 自动完成吗?

What's the explanation for the discrepancy? People ask about "jquery autocomplete" without specifying which one. With no direction, shouldn't I assume THE jquery UI autocomplete?

推荐答案

ANSWER

  1. 有许多与 jQuery 配合使用的自动完成小部件.

  1. There are numerous autocomplete widgets that work with jQuery.

  • There is ONLY ONE that belongs to jQuery UI. http://docs.jquery.com/UI/Autocomplete
  • There is another 3rd party user-contributed plugin that is listed on the jQuery site. This is not part of jQuery but works with jQuery. It's user-contributed.
    from jquery.com: http://docs.jquery.com/Plugins/Autocomplete
    actual home page: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
  • there are numerous others....

jquery 插件的用户有一个相当普遍的习惯,在问 SO 问题时,不知道他们正在使用哪个特定的小部件.当人们真正指的是a jquery 自动完成小部件"时,人们会使用诸如the jquery 自动完成小部件"之类的短语.

There is a habit that is fairly common among users of jquery plugins, when asking questions on SO, to not identify which particular widget they are using. People use phrases like "the jquery autocomplete widget" when they really are referring to "a jquery autocomplete widget".

这篇关于是否有不止一个 jQuery 自动完成小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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