Enqueue some code to execute after a js is ended ?

Enqueue some code to execute after a js is ended ?

I've a page where there is a propietary js widget with a button.
User press button, and the widget loads from a remote website an html table into a 'div' I placed on page.

I need to apply $('.my_div').stupidTable() on the results, so table can be sorted by clicking on headers.

I cannot find a way to 'intercept' the moment in which the html is loaded, to execute some code against it.

... stupidTable() is a 'table sorter plugin'. It's fantastic, light, and works ... but I cannot apply it 'live'...