Change JSO(N) parameters that have been set by another module I am trying to override parameters that have been set by another module. The other module uses drupal_add_js() to set the parameters. 

 $settings = array('color'=&gt;'red','type' =&gt;'round');
 drupal_add_js(array('MyData'=&gt;$settings),'setting'));


This adds a JavaScript object to the drupal.settings data object. I want to override that in another module, and I don't know how. It seems to always "ADD" to the array and NOT override it.

The following code doesn't work.

$js = drupal_add_js(null,'setting'); //&lt;-- get the JS
unset($js['setting'][1]['MyData']['color']);
drupal_add_js($js,'setting');




 $settings = array('color'=&gt;'PINK'); // &lt;- Change red to pink
 drupal_add_js(array('MyData'=&gt;$settings),'setting'));


How can I do what I am trying?
You should try this

// Get all the current javascript information
$current_js = drupal_add_js(NULL, NULL, 'header');

// Filter the information down to just the settings.
$current_js_settings = $current_js['setting'];