function drupal_js_defaults

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

drupal_get_js()

drupal_add_js()

3 calls to drupal_js_defaults()
drupal_add_js in drupal/core/includes/common.inc
Adds a JavaScript file, setting, or inline code to the page.
FrameworkTest::testLazyLoad in drupal/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
Tests that new JavaScript and CSS files are returned on an Ajax request.
locale_js_alter in drupal/core/modules/locale/locale.module
Implements hook_js_alter().

File

drupal/core/includes/common.inc, line 3741
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,
    'preprocess' => TRUE,
    'attributes' => array(),
    'version' => NULL,
    'data' => $data,
    'browsers' => array(),
  );
}