hook_js_alter

Versions
7
hook_js_alter(&$javascript)

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

See also

drupal_add_js()

@see drupal_get_js()

See also

drupal_js_defaults()

Parameters

$javascript An array of all JavaScript being presented on the page.

Related topics

Code

modules/system/system.api.php, line 387

<?php
function hook_js_alter(&$javascript) {
  // Swap out jQuery to use an updated version of the library.
  $javascript['misc/jquery.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js';
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.