function ajax_command_add_css

ajax_command_add_css($styles)

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

File

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

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!ajax.inc/function/ajax_command_add_css/7.x