Skip to main content
code highlighting & doc link
Source Link
Shawn Conn
  • 26.9k
  • 15
  • 49
  • 73

The standard way to do this in Drupal is with drupal_add_jsdrupal_add_js(), using the "setting" type, e.g.:

drupal_add_js(array('variableName' => 'value'), 'setting');

drupal_add_js(array('variableName' => 'value'), 'setting');

That will make the variable available on the JS side at Drupal.settings.variableNameDrupal.settings.variableName.

The standard way to do this in Drupal is with drupal_add_js, using the "setting" type, e.g.:

drupal_add_js(array('variableName' => 'value'), 'setting');

That will make the variable available on the JS side at Drupal.settings.variableName.

The standard way to do this in Drupal is with drupal_add_js(), using the "setting" type, e.g.:

drupal_add_js(array('variableName' => 'value'), 'setting');

That will make the variable available on the JS side at Drupal.settings.variableName.

Source Link
user36960
user36960

The standard way to do this in Drupal is with drupal_add_js, using the "setting" type, e.g.:

drupal_add_js(array('variableName' => 'value'), 'setting');

That will make the variable available on the JS side at Drupal.settings.variableName.