function ajax_command_alert

Creates a Drupal Ajax 'alert' command.

The 'alert' command instructs the client to display a JavaScript alert dialog box.

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

Parameters

$text: The message string to display to the user.

Return value

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

Related topics

1 call to ajax_command_alert()
ajax_prepare_response in drupal/core/includes/ajax.inc
Converts the return value of a page callback into an Ajax commands array.

File

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

Code

function ajax_command_alert($text) {
  return array(
    'command' => 'alert',
    'text' => $text,
  );
}