function ajax_command_add_css

Creates a Drupal Ajax 'add_css' command.

This method will add css via ajax in a cross-browser compatible way.

This command is implemented by Drupal.ajax.prototype.commands.add_css() defined in misc/ajax.js.

Parameters

$styles: A string that contains the styles to be added.

Return value

An array suitable for use with the ajax_render() function.

See also

misc/ajax.js

Related topics

2 calls to ajax_command_add_css()
ajax_forms_test_advanced_commands_add_css_callback in modules/simpletest/tests/ajax_forms_test.module
Ajax callback for 'add_css'.
ajax_render in includes/ajax.inc
Renders a commands array into JSON.

File

includes/ajax.inc, line 1313

Code

function ajax_command_add_css($styles) {
    return array(
        'command' => 'add_css',
        'data' => $styles,
    );
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.