I did similar things with this before:
$.append(html,listener);
This will work for me because the listener will be added AFTER html is loaded.
And I can't do this:
$.html(html);
listener();
Because this way I can't ensure html is loaded.
How to do it the right way?