views:

59

answers:

1

I'm using the jquery-autocomplete plugin of Jörn Zaefferer and I can't understand the use of this line in the fillList() function:

$.data(li, "ac_data", data[i]);

Please help me. Thanks.

+1  A: 

jQuery.data

each tag "li" which creates, assigns the data in "ac_data" with the value in data[i];

variable declaration data:

    var listItems,
     active = -1,
     data,
     term = "",
     needsInit = true,
     element,
     list;

assigning value to variable data:

 display: function(d, q) {
  init();
  data = d;
  term = q;
  fillList();
 },
andres descalzo
Then it turns out that ac_data acts like a variable, am I right? Thanks.
jean27
is as creating a property for each "li" with the name "ac_data" and the value of "data[i]"
andres descalzo
I already got it.
jean27