Hi -
I am confused about some of the changes to handling of Javascript settings in Drupal 7, and I haven't been able to find any answers to my questions online.
I see that things have changed so that sub-properties of Drupal.behaviors must have "attach" methods, and can also provide an optional "detach" method. I also understand that "settings" are passed to the attach methods in order to expand Javascript settings in order to keep up with changes during AJAX calls.
In my case, though, I just need to keep track of some settings that are defined as the page is built and will not need to change later. In Drupal 6, Drupal.settings would look something like this:
Drupal.settings.mymodule.key = value
But now it looks like this:
Drupal.settings.mymodule.key = array(value)
And after an AJAX call, even if I don't change the settings, I wind up with this:
Drupal.settings.mymodule.key = array(value, value)
And so on... In other words, each time there is an AJAX call, the items in Drupal.settings are re-added, and I wind up with constantly-expanding arrays rather than single/atomic pieces of data. This isn't only messing up what my module does, but is also confusing another Drupal module I'm relying on that is encountering arrays within Drupal.settings where it expects integers and strings.