Communicating with Drupal from Javascript/Jquery (Drupal 7) I am trying to create a dynamically populated select list field widget.  This widget consists of three Jquery multiple selects.  When the user makes a selection from the first select list I need to dynamically populate the contents of the second select list.  My problem is that I need to access data stored in Drupal about what should be put in the second list based on the first selection and the only way I can think to access this data is through an ajax call to a Drupal endpoint.  Waiting for the return from an ajax call is going to be to slow for a useable widget so I need a better way to access this data stored in Drupal.  How should one go about doing this?
You can send variables to your JS with drupal_add_js() in the $settings array.

An other way (the dirty one) to do it would be to print your data in a hidden div and read it with your JS. (don't hesitate to ask if you need code to do it)

Have fun !