Possible Duplicate:
In jQuery, what does $.fn. mean?
Can someone explain the code below a little more ?
I see that a function called isdirty is defined.
What I don’t get is:
- What is $.fn ?
-
The second line calls the function on a selector.
The function now seems a method of the object I selected ???
Can i attach this function to all objects like this?(function($) { $.fn.isdirty = function(settings) { alert(test); }}; $('.dirtycheck').isdirty();
$.fnis a shortcut tojQuery.prototype. When you augment theprototype, all jQuery objects will have access to that new method.this. The general form is…