When I tried some late-loading JS with ui-tabs, I found that Chrome would not run the code inside my <script> tag. Opera, FF and IE were fine. I did not test Safari but since it shares a lot of code with Chrome, it will probably fail too. Perhaps some sort of security feature since it forces you to introduce all the "dangerous stuff" upfront. As I said, I am not unhappy about this at all since it stopped me from going down a route that I hate: to get to where YOU want to be, you end up with HTML and JS code interspersed in one messy late-loading HTML file. Instead, I do like so:
panel.js:
uiDialogPanelReady= function() {
$("#lateTag").doThisAndThat():
};
panel.html:
<div id="lateTag"></div>
index.js:
(function($){
lateLoad= function() {
$.ajax({
url: "panel.html",
success: function(html) {
$("#uiDialogPanel").html(html);
uiDialogPanelReady();
}
});
}
})(jQuery);
index.html
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="panel.js"></script>
<input type="button" value="Load" onclick="lateLoad" />
Now, please appreciate that the above is pseudo-code. I am polluting the global namespace for brevity of presentation. You will have your own schema for namespace management, and this will easily slot into it, I am sure.
Good luck.
PS: Don't hold out for any enhancements to ui-dialog. I don't think that support for late-loading is at all necessary, and may not even be successful given the browser issues mentioned.
PPS: It just occurred to me that I misread your intentions. You were not using <script> tags inside your late HTML (which in IE, Opera and FF would have solved your timing issue). You were loading you late code upfront (as I do now) but launched it with the $(document).ready function, which cannot work. My "trick" is to introduce as many ready functions as I have late loading panels...