Perform necessary alterations to the JavaScript before it is presented on the page.
$javascript: An array of all JavaScript being presented on the page.
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';
}