Drupal 6 and jquery 1.4 / 1.5

Is there a way in drupal 6 to use jquery 1.5 / 1.4 in non-admin pages without breaking basic functionality on pages without an administrator?

+6
source share
1 answer

Yes.

Install and enable http://drupal.org/project/jquery_update

Download the jQuery version you want and put along with the ones included in the module.

Edit module

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')] ; } } 

Use the file name for the downloaded version.

There is a problem with editing above, but I have a link at work. I will update the answer tomorrow with a link.

I have this work live on sites with no problems.

Application:

This is a link to the topic / patch about the problem: http://drupal.org/node/775924#comment-2987316

+4
source

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


All Articles