Created
July 21, 2014 17:26
-
-
Save Itaqua/8c06f5fc853db08ae9c0 to your computer and use it in GitHub Desktop.
isJQueryVersionAtLeast: Permite ver si una version es al mayor o igual que una minima definida
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
function isJQueryVersionAtLeast(mayor, minor, fix){ | |
var minVersion = [mayor,minor, fix]; | |
var currVersion = $.map($.fn.jquery.split('.'), function(item, index){ | |
return parseInt(item); | |
}); | |
return currVersion[0] > minVersion[0] || | |
(currVersion[0] == minVersion[0] && | |
(currVersion[1] > minVersion[1] || | |
(currVersion[1] == minVersion[1] && | |
currVersion[2] >= minVersion[2]))); | |
} | |
isJQueryVersionAtLeast(1,2,3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment