8.3.x common.inc drupal_js_defaults($data = NULL)
8.0.x common.inc drupal_js_defaults($data = NULL)
8.1.x common.inc drupal_js_defaults($data = NULL)
8.2.x common.inc drupal_js_defaults($data = NULL)
8.4.x common.inc drupal_js_defaults($data = NULL)
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

drupal_get_js()

drupal_add_js()

3 calls to drupal_js_defaults()
AJAXFrameworkTestCase::testLazyLoad in modules/simpletest/tests/ajax.test
Test that new JavaScript and CSS files added during an AJAX request are returned.
drupal_add_js in includes/common.inc
Adds a JavaScript file, setting, or inline code to the page.
locale_js_alter in modules/locale/locale.module
Implements hook_js_alter().

File

includes/common.inc, line 4351
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,
    'requires_jquery' => TRUE,
    'scope' => 'header',
    'cache' => TRUE,
    'defer' => FALSE,
    'preprocess' => TRUE,
    'version' => NULL,
    'data' => $data,
  );
}