jquery_dollar.module in jQuery Dollar 7
Same filename and directory in other branches
File
jquery_dollar.moduleView source
<?php
/**
* Implements hook_js_alter().
* This function will add a js file immediately after drupal.js that declares:
* $ = jQuery;
* This allows all other code to use the $ convention for writing jQuery code
* The reason is that forcing users to use special closures to make jQuery compatible with the $ are
* superfluous, confusing, and complicated.
* More here: http://drupal.org/node/1407256
*/
function jquery_dollar_js_alter(&$javascript) {
$file = drupal_get_path('module', 'jquery_dollar') . '/jquery_dollar.js';
// Copy all properties of drupal.js.
$javascript[$file] = $javascript['misc/drupal.js'];
// Replace the file to load.
$javascript[$file]['data'] = $file;
// Minimally increase the weight to be loaded directly after drupal.js.
$javascript[$file]['weight'] += 0.1;
}
Functions
Name![]() |
Description |
---|---|
jquery_dollar_js_alter | Implements hook_js_alter(). This function will add a js file immediately after drupal.js that declares: $ = jQuery; This allows all other code to use the $ convention for writing jQuery code The reason is that forcing users to use special closures to… |