Skip to content

Instantly share code, notes, and snippets.

@BlackPrincess
Created December 6, 2013 10:07
Show Gist options
  • Select an option

  • Save BlackPrincess/7821410 to your computer and use it in GitHub Desktop.

Select an option

Save BlackPrincess/7821410 to your computer and use it in GitHub Desktop.
こんなの書くとか
$.extend({
version:function() {
var v = $($().jquery.split(".")).map(function(){ return parseInt(this,10);})
return {
major:v[0],
minor:v[1],
revision:v[2]
}
},
isOldVersion:function(major, minor, revision) {
var v = $.version();
var a = v.major * 100 * 1000 + v.minor * 1000 + v.revision
var b = major * 100 * 1000 + minor * 1000 + revision
return a < b;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment