Skip to content

Instantly share code, notes, and snippets.

@rmanalan
Created October 5, 2010 23:51
Show Gist options
  • Save rmanalan/612566 to your computer and use it in GitHub Desktop.
Save rmanalan/612566 to your computer and use it in GitHub Desktop.
Illustration of a jQuery like object
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