Last active
August 29, 2015 14:03
-
-
Save bttmly/549a2ea8a363484caf2f to your computer and use it in GitHub Desktop.
extending the jQuery class
This file contains hidden or 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
class JQueryInheritor extends jQuery | |
constructor: ( arg ) -> | |
jQuery.fn.init.call( this, arg ); | |
myMethod = -> | |
# do something |
This file contains hidden or 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
function JQueryInheritor( arg ) { | |
jQuery.fn.init.call( this, arg ); | |
} | |
JQueryInheritor.prototype = Object.create( jQuery.prototype ); | |
JQueryInheritor.prototype.myMethod = function(){ | |
// do something | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment