Created
September 12, 2012 03:26
-
-
Save GRMule/3704114 to your computer and use it in GitHub Desktop.
blackCoffee, the newest javascript framework
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
/* | |
blackCoffee is the ultra-light, ultra-fast alternative to jQuery. Our slogan is: | |
--> Write the same amount, do an equal amount as you otherwise may have done | |
It isn't very catchy -- now taking suggestions for a better slogan! | |
*/ | |
var blackCoffee = function (selector) { | |
if (typeof selector != 'string') | |
return null; | |
if (selector.match('#')){ | |
return document.getElementById( | |
selector.replace('#', '') | |
); | |
} | |
return document.getElementsByClassName( | |
selector.replace('.', '') | |
); | |
}; | |
var $ = blackCoffee; | |
// Try it here: http://jsfiddle.net/bM8c6/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New slogan: "Has anyone really been far even as decided to use even go want to do look more like!?"