jquery ui dialog box, with embeded javascript ( $(document).ready fires too early?

jquery ui dialog box, with embeded javascript ( $(document).ready fires too early?

jquery ui dialog box, with embeded javascript ( $(document).ready fires too early?
i'm trying to test out jquery ui dialog , i currently use the jquery plugin impromptu - it works well but not themable with jquery ui.
anyhow i am displaying the dialog with a form in it, the form is loaded using ajax to return the html
var $dialog = var $dialog = $('<div></div>')
     .html(data.html) //data.html is the return from ajax call
     .dialog({
   autoOpen: true
   width: 400,
   modal: true,
   buttons: {,,,}

the html contains javascript:
<script type="text/javascript" >
$(document).ready(function() {
  alert('hi');
   console.log($("#combobox"));
        
});
</script>
where combobox is a select item in the html
the alert will fire, 
however $("#combobox") will return empty, if i run $("#combobox") from firebug console after it is loaded, it finds and returns the combobox
I don't want to use the .open() callback function of dialog