In my application I have some simple logic behind a dialog window which pops up to show a login form. There is a [x] button to close the dialogue.
I have some events mapped to action the buttons on the form including that [x] to close the dialog.
Rather than repeat myself on a successful login, I can drop in a
$('.close_button').click() which will then take advantage of the events I already have.
The only other option I have would be to write a function in the global namespace to handle closing of the dialog, and call that in the helper and on a successful login.