How to abort the ajax request and redirect in the ajax callback of form element I want to redirect the page in the ajax callback function, and nothing (like "header", "drupal_goto" etc.) works for redirect in the ajax callback function.
If you've got ctools installed (nearly all Drupal sites do), you can make use of ctools_ajax_command_redirect() in your AJAX callback, e.g.

ctools_include('ajax');
$commands[] = ctools_ajax_command_redirect('path/to/redirect');
return array('#type' =&gt; 'ajax', '#commands' =&gt; $commands);