Skip to content

Instantly share code, notes, and snippets.

@jofi
Created May 2, 2014 06:54
Show Gist options
  • Save jofi/c3c8f47437f57ec183ed to your computer and use it in GitHub Desktop.
Save jofi/c3c8f47437f57ec183ed to your computer and use it in GitHub Desktop.
JavaScript classes
function Something(attr) {
this.attr = attr;
this.doSomething();
this.initSomething();
$(this.activator).bind('click', {editor: this}, this.clickHandler);
};
Something.prototype = {
doSomething: function() {
// blabla bla
},
initSomething: function() {
// blabla bla
},
};
(function(jQuery){
jQuery.fn.extend({
something: function() {
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment