Skip to content

Instantly share code, notes, and snippets.

@Itaqua
Created July 21, 2014 17:26
Show Gist options
  • Save Itaqua/8c06f5fc853db08ae9c0 to your computer and use it in GitHub Desktop.
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
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