function drupal_js_defaults
7.x common.inc | drupal_js_defaults($data = NULL) |
Constructs an array of the defaults that are used for JavaScript items.
Parameters
$data: (optional) The default data parameter for the JavaScript item array.
See also
3 calls to drupal_js_defaults()
- AJAXFrameworkTestCase::testLazyLoad in drupal-7.x/
modules/ simpletest/ tests/ ajax.test - Test that new JavaScript and CSS files added during an AJAX request are returned.
- drupal_add_js in drupal-7.x/
includes/ common.inc - Adds a JavaScript file, setting, or inline code to the page.
- locale_js_alter in drupal-7.x/
modules/ locale/ locale.module - Implements hook_js_alter().
File
- drupal-7.x/
includes/ common.inc, line 4215 - Common functions that many Drupal modules will need to reference.
Code
function drupal_js_defaults($data = NULL) {
return array(
'type' => 'file',
'group' => JS_DEFAULT,
'every_page' => FALSE,
'weight' => 0,
'scope' => 'header',
'cache' => TRUE,
'defer' => FALSE,
'preprocess' => TRUE,
'version' => NULL,
'data' => $data,
);
}