function ajax_command_remove

ajax_command_remove($selector)

Creates a Drupal Ajax 'remove' command.

The 'remove' command instructs the client to use jQuery's remove() method to remove each of elements matched by the given selector, and everything within them.

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

Parameters

$selector: A jQuery selector string. If the command is a response to a request from an #ajax form element then this value can be NULL.

Return value

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

See also

http://docs.jquery.com/Manipulation/remove#expr

Related topics

File

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

Code

function ajax_command_remove($selector) {
  return array(
    'command' => 'remove',
    'selector' => $selector,
  );
}

© 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_remove/7.x