Info on Drupal.settings and #attached
#attached can be used as follows. 

$form['#attached']['js'][] = array(
  'data' =&gt; array(
    'xx_system' =&gt; array(
        'xx_code' =&gt; variable_get('xx_code', 'xx'),
        'xx_key' =&gt; variable_get('xx_key', 'xx'),
      ),
    ),
  'type' =&gt; 'setting',
);


With drupal_add_js(), you can use the following code.

 drupal_add_js(array('orgs' =&gt; $orgs), array('type' =&gt; 'setting'));
 drupal_add_js(drupal_get_path('module', 'module_name') . '/module_name.js');


In a JavaScript file, you can get the value of the variables as follows. 

  Drupal.behaviors.module_name = {
    attach: function (context, settings) {
      var cities = Drupal.settings.orgs.cities;// you will get the cities value here
    }
  };