📜 ⬆️ ⬇️

jQuery 1.4.2 for the frontend of the site

A bunch of interesting and useful buns work with jQuery version 1.4.2, which is not in Drupal (it seems to me and is not expected).

1. Install jQuery update (contains version 1.3.2)

2. Download jQuery 1.4.2: jquery-1.4.2.min.js (Minified version) and jquery-1.4.2.js (Source version).
')
3. Copy the downloaded versions to / sites / all / modules / jquery_update / replace /

4. Open the file /sites/all/modules/jquery_update/jquery_update.module, find the function

/**
* Return the path to the jQuery file.
*/

function jquery_update_jquery_path() {
$jquery_file = array( 'none' => 'jquery.js' , 'min' => 'jquery.min.js' );
return JQUERY_UPDATE_REPLACE_PATH . '/' . $jquery_file[variable_get( 'jquery_update_compression_type' , 'min' )];
}


* This source code was highlighted with Source Code Highlighter .

and change it (you can just comment out the old one) to

/**
* Return the path to the jQuery file.
*/
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.4.2.js' , 'min' => 'jquery-1.4.2.min.js' );
return JQUERY_UPDATE_REPLACE_PATH . '/' . $jquery_file[variable_get( 'jquery_update_compression_type' , 'min' )];
}
}


* This source code was highlighted with Source Code Highlighter .

Source: https://habr.com/ru/post/94510/


All Articles