Created
October 5, 2010 23:51
-
-
Save rmanalan/612566 to your computer and use it in GitHub Desktop.
Illustration of a jQuery like object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $w = function(){ | |
var $w = function(){ | |
return new $w.init; | |
} | |
$w.prototype = { | |
// add all of the methods/props you want accessible as $w().method() or $w().prop here: | |
init: function(){ | |
console.log('init called'); | |
}, | |
length: 0 | |
} | |
$.extend($w,{ | |
// add all of the methods/props you want accessible as $w.method() or $w.prop here: | |
sayHello: function(){ | |
console.log('hello'); | |
} | |
}) | |
return $w; | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment