Is it possible, within a javascript file, to do an if based on the current jquery version? like:

if ($.version == '1.2.3') {
  // Drupal 6
}

Thanks!

Comments

dmitrig01’s picture

It's completely possible, although 1.2.3 doesn't necessarily mean Drupal 6 – it could be that someone has installed the jQuery Update module.

[Drupal++]

will_in_wi’s picture

I just want to know if I can use a method that is only in later versions of jquery. I searched and couldn't find any method for determining the version. Do you know offhand what it is?

Thanks!

Update: Whatever the method is needs to be backwards compatible to stock jquery from d5.

will_in_wi’s picture

I think I found the solution:

http://dev.jquery.com/ticket/829