saving JS settings in theme_settings.php file i am working on a responsive D7 theme and need some JS settings to be saved via theme settings form not a custom module. i did following codes to give what i want but it seems that Using drupal_add_js() function to add JS settings in theme_settings.php file doesn't work. could you please point out what is the problem and is there any alternative solution?
some of my codes in theme_settings.php file is as followings:

/**
* Implements hook_form_system_theme_settings_alter()
*/
function glossy_form_system_theme_settings_alter(&amp;$form, &amp;$form_state) {
    $theme = alpha_get_theme();

    $lib_options = false;

    /** add mobileMenu options to theme settings */
    if (isset($theme-&gt;settings['libraries']['glossy_mobileMenu'])) {
        $lib_options = true;
        $form['alpha_settings']['glossy_lib_options']['mobileMenu'] = array(
            '#type' =&gt; 'fieldset',
            '#weight' =&gt; -10,
            '#title' =&gt; t('mobileMenu options'),
        );

        $form['alpha_settings']['glossy_lib_options']['mobileMenu']['mobileMenu_selector'] = array(
            '#type' =&gt; 'textfield',
            '#description' =&gt; t('Select the CSS selector of the container that all inner menus will be responsive. e.g. %example', array('%example' =&gt; '.navigation')),
            '#title' =&gt; t('responsive menu container selector'),
            '#default_value' =&gt; theme_get_setting('mobileMenu_selector'),
        );

        $form['alpha_settings']['glossy_lib_options']['mobileMenu']['mobileMenu_title'] = array(
            '#type' =&gt; 'textfield',
            '#description' =&gt; t('e.g. Select a page'),
            '#title' =&gt; t('First option text'),
            '#default_value' =&gt; theme_get_setting('mobileMenu_title'),
        );

        $form['alpha_settings']['glossy_lib_options']['mobileMenu']['mobileMenu_indent'] = array(
            '#type' =&gt; 'textfield',
            '#description' =&gt; t('e.g. !string', array('!string' =&gt; '&amp;nbsp;&amp;nbsp;&amp;nbsp;')),
            '#title' =&gt; t('string for indenting nested items'),
            '#default_value' =&gt; theme_get_setting('mobileMenu_indent'),
        );

        // add submit handler
        $form['#submit'][] = 'glossy_mobileMenu_submit';       
    }

    if ($lib_options) {
        $form['alpha_settings']['glossy_lib_options']['#type'] = 'fieldset';
        $form['alpha_settings']['glossy_lib_options']['#weight'] = -10;
        $form['alpha_settings']['glossy_lib_options']['#title'] = t('Libraries options');
    }
}

function glossy_mobileMenu_submit($form, &amp;$form_state){
    // Add the mobileMenu options variables.
    drupal_add_js(array(
        'responsive_menu_options' =&gt; array(
            'selector' =&gt; $form_state['values']['mobileMenu_selector'],
            'title' =&gt; $form_state['values']['mobileMenu_title'],
            'indent' =&gt; $form_state['values']['mobileMenu_indent'],
        ),
    ), array('type' =&gt; 'setting', 'scope' =&gt; JS_DEFAULT));
}


thanks in advance.
I think you problem is this: drupal_add_js needs to be called at runtime. It's not some kind of registry function that adds your js file for every future page request. In other words, your code only adds the js when the form is being submitted.

Instead of calling drupal_add_js in your submit handler, store a variable using variable_set() to indicate that the js must be added. In your template.php file you can use the _preprocess_page function to retrieve the setting using variable_get() and call drupal_add_js if needed.