Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291228

Isn't there a "data" key to the $options parameter of drupal_add_js()?

$
0
0

API page: http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_a...

Looking at http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht..., the example states "You add a javascript setting by using the 'data' key (as php keys can't be arrays)" and shows:

$settings = array('id' => 'mymodule-element-1');
$form['#attached']['js'][] = array(
  'data' => array('mymodule' => $settings),
  'type' => 'setting',
);

So the $data parameter is an integer in the form example. If calling this function directly, then $data is NULL.


Viewing all articles
Browse latest Browse all 291228

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>