Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.809 diff -u -r1.809 common.inc --- includes/common.inc 15 Oct 2008 16:05:51 -0000 1.809 +++ includes/common.inc 16 Oct 2008 15:26:13 -0000 @@ -2046,57 +2046,100 @@ * settings are required by some modules to function properly. The settings * will be accessible at Drupal.settings. * + * Examples: + * @code + * drupal_add_js('misc/collapse.js'); + * drupal_add_js('misc/collapse.js', 'module'); + * drupal_add_js('$(document).ready(function(){alert("Hello!");});', + * array('type' => 'inline', 'scope' => 'footer') + * ); + * @endcode + * * @param $data - * (optional) If given, the value depends on the $type parameter: + * (optional) If given, the value depends on the $options parameter: * - 'core', 'module' or 'theme': Path to the file relative to base_path(). * - 'inline': The JavaScript code that should be placed in the given scope. * - 'setting': An array with configuration options as associative array. The * array is directly placed in Drupal.settings. You might want to wrap your * actual configuration settings in another variable to prevent the pollution * of the Drupal.settings namespace. - * @param $type - * (optional) The type of JavaScript that should be added to the page. Allowed - * values are 'core', 'module', 'theme', 'inline' and 'setting'. You - * can, however, specify any value. It is treated as a reference to a JavaScript - * file. Defaults to 'module'. - * @param $scope - * (optional) The location in which you want to place the script. Possible - * values are 'header' and 'footer' by default. If your theme implements - * different locations, however, you can also use these. - * @param $defer - * (optional) If set to TRUE, the defer attribute is set on the