1. drupal
    1. 8
    2. 7
8 – 7 ajax_command_after($selector, $html, $settings = NULL)

Creates a Drupal Ajax 'insert/after' command.

The 'insert/after' command instructs the client to use jQuery's after() method to insert the given HTML content after each element matched by the given selector.

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


$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.

$html The data to use with the jQuery after() method.

$settings An optional array of settings that will be used for this command only.

Return value

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

See also


Related topics


includes/ajax.inc, line 974

function ajax_command_after($selector, $html, $settings = NULL) {
  return array(
    'command' => 'insert', 
    'method' => 'after', 
    'selector' => $selector, 
    'data' => $html, 
    'settings' => $settings,