Created
September 29, 2010 19:39
-
-
Save lsmith/603391 to your computer and use it in GitHub Desktop.
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
YUI.add('node++', function (Y) { | |
// define a function that will run in the context of a | |
// Node instance: | |
function doSomethingAwesome() { | |
Y.log("Do something awesome here."); | |
} | |
// use addMethod to add doAwesomeThing to the Node prototype: | |
Y.Node.addMethod("doAwesomeThing", doSomethingAwesome); | |
// add this functionality to NodeLists: | |
Y.NodeList.importMethod(Y.Node.prototype, "doAwesomeThing"); | |
}, '0.0.1', { requires: ['node'] }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment