Created
August 4, 2016 18:37
-
-
Save talbergs/765c1fc3b5af0d61e7ef2bf37a84578b 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
jQuery.prototype.$cache = function(xpath, name) { | |
if (xpath.forEach) { | |
xpath.forEach(function(xp){ | |
this.$cache(xp); | |
}.bind(this)); | |
} else { | |
!name && (name = xpath.substr(1)); | |
this[name] = this.find(xpath) | |
} | |
return this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment