1 ajax.inc ajax_command_add_css($styles)

Creates a Backdrop Ajax 'addCss' command.

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

This command is implemented by Backdrop.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

core/includes/ajax.inc, line 1522
Functions for use with Backdrop's Ajax framework.

Code

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