Created
July 26, 2012 14:24
-
-
Save kswlee/3182346 to your computer and use it in GitHub Desktop.
jQuery init function (partial)
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
| init: function( selector, context, rootjQuery ) { | |
| var match, elem, ret, doc; | |
| // Handle $(""), $(null), or $(undefined) | |
| if ( !selector ) { | |
| return this; | |
| } | |
| // Handle $(DOMElement) | |
| if ( selector.nodeType ) { | |
| this.context = this[0] = selector; | |
| this.length = 1; | |
| return this; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment