Understanding the usage of the .data() method .
I have a question about the $.data() method , actually about JavaScript terminology ,
HERE , is the documentation for the data() method and there is the following example:
- var div = $( "div" )[ 0 ];
- jQuery.data( div, "test", {
- first: 16,
- last: "pizza!"
- });
now in the above example i can describe, the usage of the .data() method as follows:
"the data method is being used to associate arbitary data to the <div> element. "
now i was going through the code of animateSlider.js and came across the following line of code:
- $.data(this,"animateSlider",new animateSlider(this,options).init());
Well i understand what that line of code is doing ?, but if you had to document what exactly the above line of code was doing , what would you say ?
"the data method is being used to associate a instance of animateSlider to the element" ?? how would you document the usage of the data() method in the above line of code.
is that correct ?
P.S. the line in concern can be seen
HERE .