When writing a new jQuery plugin is there a straightforward way of checking that the current version of jQuery is above a certain number? Displaying a warning or logging an
What about:
function minVersion(version) {
var $vrs = window.jQuery.fn.jquery.split('.'),
min = version.split('.'),
prevs=[];
for (var i=0, len=$vrs.length; i min[i])
prevs[i] = 1;
else
prevs[i] = 0;
}
}
return true;
}
I wrote that code on my forked gist: https://gist.github.com/budiadiono/7954617, original code written by dshaw on: https://gist.github.com/dshaw/652870.