call javascript function after ajax form submit How do I call a javascript function after a successful ajax form submit?  I want to call a function in a file that I added with drupal_add_js() in my_form_name_form($form, &amp;$form_state).
Have a look at the Ajax framework and Ajax framework commands topics in the API documentation.

Basically, instead of simply returning a single render array, you can return a number of so called ajax commands, which will be translated to javascript and executed on the client side. Replacing the specified wrapper with the returned content is just the default command that is done when nothing else is specified.

There doesn't seem to be a provided command that allows to execute any javascript method (only an invoke command that allows to execute an jQuery command on a defined selector) though. However, you can either define your own command (just have a look at what these helper functions return and the corresponding JS functions in misc/ajax.js (look for Drupal.ajax.prototype.commands = {...).

Or you might be able to replace your custom JS function with a number of the provided default ajax commands. They're pretty flexible and I'm for example using them to update the page title in userpoints.module.