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 drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
Ajax callback for 'add_css'.
ajax_render in drupal/core/includes/ajax.inc
Renders a commands array into JSON.

File

drupal/core/includes/ajax.inc, line 1154
Functions for use with Drupal's Ajax framework.

Code

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