views:

499

answers:

3

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

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.

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:

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 
  });  

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?

+2  A: 

A Google search reveals many different jQuery autocomplete plugins, including four named jQuery autocomplete.

SLaks
I know there are many autocomplete options; that's why I wrote `I know there are third-party autocomplete widgets`. My point is, which widget are people asking about, when they say 'jquery autocomplete' when it is obviously NOT the jQuery UI autocomplete? Is there some "other" dominant autocomplete which is used everywhere but yet is not the official one?
Cheeso
Yes, there are four them them.
SLaks
And.....? Is there a dominant one?
Cheeso
+5  A: 

ANSWER

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

  2. 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".

Cheeso
+1  A: 

There are many. I even know of one that has hijacked the jquery-autocomplete tag on StackOverflow. Direct from the support page:

If you want to use jquery-autocomplete, you may have some questions. We suggest you ask your questions on StackOverflow, and use the jquery-autocomplete tag to identify them.

Peter Di Cecco