-5

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.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
javapatriot
  • 353
  • 4
  • 15

2 Answers2

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
-1

This should work.

jQuery.fn.jquery;

Blog reference

Mike Sherrill 'Cat Recall'
  • 91,602
  • 17
  • 122
  • 185