Created
January 31, 2013 15:48
-
-
Save yckart/4683843 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
var getPrefix = (function(browser) { // Closure for putting result in cache | |
var prefixes = {firefox:'moz', applewebkit:'webkit', webkit:'webkit', opera:'o', msie:'ms'}; | |
for (var p in prefixes) | |
if (browser.indexOf(p) !== -1) return prefixes[p]; | |
return false; | |
})(navigator.userAgent.toLowerCase()); | |
// console.log(getPrefix); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment