diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-02-18 13:46:55 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-02-18 13:46:55 +0000 |
commit | ac484c277a0ac0627561d2cac1f4ea47ab5da00b (patch) | |
tree | eac82650ab4c17d3f62461127403e2aff344cd82 /includes | |
parent | b6025a8820ffc84fccbde3a8f77ba6f9c183bfc4 (diff) | |
download | brdo-ac484c277a0ac0627561d2cac1f4ea47ab5da00b.tar.gz brdo-ac484c277a0ac0627561d2cac1f4ea47ab5da00b.tar.bz2 |
#125030 by kkaefer, quicksketch, dvessel, Steven, and John Resig: Allow compatibility with other JavaScript libraries.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc index 7b97fe67d..806ae97e0 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2334,6 +2334,8 @@ function drupal_clear_css_cache() { * directly in the page. This can, for example, be useful to tell the user that * a new message arrived, by opening a pop up, alert box etc. This should only * be used for JavaScript which cannot be placed and executed from a file. + * When adding inline code, make sure that you are not relying on $ being jQuery. + * Wrap your code in (function($) { ... })(jQuery); or use jQuery instead of $. * * - Add settings ('setting'): * Adds a setting to Drupal's global storage of JavaScript settings. Per-page @@ -2344,8 +2346,8 @@ function drupal_clear_css_cache() { * @code * drupal_add_js('misc/collapse.js'); * drupal_add_js('misc/collapse.js', 'file'); - * drupal_add_js('$(document).ready(function(){alert("Hello!");});', 'inline'); - * drupal_add_js('$(document).ready(function(){alert("Hello!");});', + * drupal_add_js('jQuery(document).ready(function(){alert("Hello!");});', 'inline'); + * drupal_add_js('jQuery(document).ready(function(){alert("Hello!");});', * array('type' => 'inline', 'scope' => 'footer', 'weight' => 5) * ); * @endcode |