Is it possible to check to specific version (1.6) of jQuery using an IF statement. I know you can do it for jQuery in general but i need something a little more granular.
Asked
Active
Viewed 151 times
-5
-
In what situation would you need this? Just reference the version you want. – Corey Ogburn Aug 20 '13 at 15:52
-
Yes. `jQuery.fn.jquery` gives you the version number. – Kevin B Aug 20 '13 at 15:52
-
1What prevented you from reading the documentation? – Lightness Races in Orbit Aug 20 '13 at 15:52
-
what do you mean 'in general' and why do you think it cannot be used inside `if`? – John Dvorak Aug 20 '13 at 15:53
-
hah, this is a duplicate of a duplicate – Kevin B Aug 20 '13 at 15:55
2 Answers
1
Yes; the jQuery documentation, upon searching for the keyword "version"
, tells us to write:
alert( 'You are running jQuery version: ' + $.fn.jquery );
and that:
The
.jquery
property is assigned to the jQuery prototype, commonly referred to by its alias$.fn
. It is a string containing the version number of jQuery, such as "1.5.0" or "1.4.4".

Lightness Races in Orbit
- 378,754
- 76
- 643
- 1,055