Drupal AJAX forms & commands
As a backup solution, I'll do it this way:

$form['#suffix'] = '&lt;script type="text/javascript"&gt;some_function_to_do_what_i_need();&lt;/script&gt;';
return $form;


this should work.