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 error otherwise.
It would be nice to do something like:
jQuery.version >= 1.2.6
in some form or another.
Found this in jquery.1.3.2 source:
I didn't check, but something like "$.fn.jQuery" might work.
What about:
}
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.
Here is a check I used to make sure the user was using at least v. 1.3.2 of jQuery.
since there is no jquery version that us more than one digit, you can safely use
I'm surprised no one has given this solution yet:
Instead of using
parseInt
as i saw in one of the answers above i would suggest to useparseFloat
as mentioned below