11

The Drupal 6 version of jQuery is too old (1.26). Could I delete, and replace it with a newer version?

4 Answers 4

8

Deleting the jQuery library used by Drupal 6 and replacing it with a newer version (especially if the new version is 1.3.x, or 1.4.x) is not a good idea because Drupal core JavaScript code (but also JavaScript code used by third-party modules) would stop working.

Some versions of jQuery comes with a compatibility file that allows to code though for the previous version of the library to work with the new version; sometimes, that single compatibility file is not enough for Drupal, as it is shown by the jQuery Update project, which replaces some of the JavaScript files used by Drupal, including ahah.js, tabledrag.js, and teaser.js.

As of 14 August 2011, the jQuery library used by the latest Drupal 6 version of jQuery Update is 1.3.2; jQuery 1.2.6 is the version used by the latest Drupal 5 version.

11

No, that would not be advisable; instead, use the jQuery Update module.

1
  • 3
    it's not unheard of to make Drupal 6 work with jQuery 1.4+ but it takes a lot of core hacking and patience, I wouldn't recommend it for anything other than a personal project. For most other stuff use jQuery Update and get used to 1.3.2 :)
    – Alex Weber
    Commented Mar 23, 2011 at 9:34
3

There's nothing wrong with using a newer version of jQuery alongside Drupal's core version of jQuery. The function noConflict() is made for running a jQuery library alongside another javascript library, even if it's just another version of jQuery (http://api.jquery.com/jQuery.noConflict/).

I wrote a post about using noConflict + your custom jQuery version and scripts here: http://drupal.org/node/1058168

2

For what it's worth:

  • Drupal 5: jQuery 1.2.6
  • Drupal 6: jQuery 1.3.2
  • Drupal 7: jQuery 1.5.1 and jQuery UI 1.8.11

With the release of IE9 imminent, and jQuery 1.5.1 release was made to fix all bugs related to IE9, does it make sense to put this release into D7? Their changelog suggests many IE related bugs were fixed.

"jQuery now supports Internet Explorer 9 as a top level browser. All known bugs have been fixed and/or been reported to the IE team for resolution in the final release."

Not the answer you're looking for? Browse other questions tagged or ask your own question.