The objective is to exclude certain javascript files from some sections of the website.
I exclude javascript and css files in this way in the template.php file of the theme:
function phptemplate_preprocess_page(&$vars) {
$scripts = drupal_add_js();
//PRINT THIS ARRAY AND UNSET THE UNWANTED ARRAY
// unset($scripts['module']['sites/default/files/js/jquery-min.js']);
unset($scripts['module']['YOUR_PATH_TO_JS']);
$vars['scripts'] = drupal_get_js('header', $scripts);
}
However it seems that jquery_update preprocess is executed after template.php, so it overrides my changes:
function jquery_update_preprocess_page(&$variables) {
...
$variables['scripts'] = drupal_get_js('header', $scripts);
}
The code is located in jquery_update.module
How would be the best approach to resolve this?
I would prefer not to hack or disable the jquery_update.module
code if possible.
Any alternative ways to exclude javascript files that doesn't involve touching the template.php file would also fix my problem I think.