Skip to content

Commit

Permalink
Documentation for $$.
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed May 4, 2009
1 parent 3d78eee commit f3d7a1e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tutorial/public/wycats.js
Expand Up @@ -66,6 +66,24 @@ jQuery.fn.setupPlugin = function(setup, options) {
}
};

// Returns an object that is bound to the first element matching the
// selector. $$ takes the same first parameter as jQuery.
//
// If you wish to add methods to the $$ object, note that the original
// node is available as this.node inside $$ function.
//
// Example:
//
// $$("#myDiv").update = function() {
// $(this.node).load(this.node.rel);
// }
//
// $$("#myDiv").update();
//
// Note that properties and methods will only be bound to a single
// element. This effectively allows the promotion of an element
// node to a full-fledged object with stateful properties and
// methods.
var $$ = function(param) {
var node = $(param)[0];
var id = $.data(node);
Expand Down

0 comments on commit f3d7a1e

Please sign in to comment.