You are here

function hook_jquery_update_alter in jQuery Update 6.2

Perform necessary alterations to the JavaScript before it is presented on the page.

Parameters

$javascript: An array of all JavaScript being presented on the page. An associative array of scopes, file paths, and then options associated with the files.

See also

drupal_add_js()

drupal_get_js()

hook_js_alter()

1 function implements hook_jquery_update_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

jquery_update_jquery_update_alter in ./jquery_update.module
Implements hook_jquery_update_alter().
1 invocation of hook_jquery_update_alter()
jquery_update_preprocess_page in ./jquery_update.module
Implementation of moduleName_preprocess_hook().

File

./jquery_update.api.php, line 15

Code

function hook_jquery_update_alter(&$javascript) {

  // Retrieve the attributes about jQuery.
  $jquery = $javascript['core']['misc/drupal.js'];

  // Remove the old one.
  unset($javascript['core']['misc/drupal.js']);

  // Swap in the new one.
  $path = drupal_get_path('module', 'jquery_update');
  $scripts['core'][$path] = $jquery;
}