ajax_test_render
- Versions
- 7
ajax_test_render()
Menu callback; Copies $_GET['commands'] into $commands and ajax_render()s that.
Additionally ensures that ajax_render() incorporates JavaScript settings by invoking drupal_add_js() with a dummy setting.
Code
modules/simpletest/tests/ajax_test.module, line 33
<?php
function ajax_test_render() {
// Prepare AJAX commands.
$commands = array();
if (!empty($_GET['commands'])) {
$commands = $_GET['commands'];
}
// Add a dummy JS setting.
drupal_add_js(array('ajax' => 'test'), 'setting');
// Output AJAX commands and end the request.
ajax_render($commands);
}
?>Login or register to post comments 