jquery ui should support deferred and promises
e.g. the tabs widget:
When activating a tab (which might be a static one, or might be a ajax load), this should give access to a promise so you can use :
.done( function () { .. } ) for writing code when activating of tab is done (again, ajax or static)
.fail( ) for writing code when activating a tab failed,
and .always for writing code to be executed in both cases.