Scroll
Update jquery to version 1.4, 1.5, 1.6 in Drupal
To update jQuery to version 1.4, 1.5, or 1.6 in Drupal, you first need to install the jQuery_update module. This module updates the jQuery version to 1.3.2, which is generally sufficient for various banners, carousels, and creating visual effects. However, in later versions of jQuery, functions for working with AJAX have changed. So, once you've installed jQuery_update, go to the module folder, copy the jQuery file into the replace
folder, and make sure the filename includes the version number, for example: jquery-1.5.2.js
. To override the jQuery file, open the jquery_update.module
file and replace the jquery_update_jquery_path()
function with the following code:
function jquery_update_jquery_path() { $curr_uri = request_uri(); if (strpos($curr_uri,'admin')>0 || strpos($curr_uri,'edit')>0 || strpos($curr_uri,'add')>0){ $jquery_file = array( 'none' => 'jquery.js', 'min' => 'jquery.min.js' ); return JQUERY_UPDATE_REPLACE_PATH .'/'. $jquery_file[variable_get('jquery_update_compression_type', 'min')]; } else { $jquery_file = array( 'none' => 'jquery-1.5.2.js', 'min' => 'jquery-1.5.2.min.js' ); return JQUERY_UPDATE_REPLACE_PATH .'/'. $jquery_file[variable_get('jquery_update_compression_type', 'min')]; } }