Jquery Modal Window populating divs
<p>I have a screen which opens a jquery modal window (from jquery ui).  This contains a div, which I need to populate via ajax.</p>

<p>I have a fully working ajax function and can see the data being returned from the server.  However I cannot get this to go into a div on the modal window.</p>

<p>Any thoughts?  I thought maybe it was running the ajax prior to the modal window opening and therefore cannot find the div to populate. I've tried alsorts, but cannot get this to work.  Any ideas guys?</p>

<pre><code>$("#manualDialog").dialog({

        resizable: false,
        autoOpen:false,
        modal: true,
        width:1000,
        height:800,
        open: function(){
                getImages(worktype,'manualimages'); //function for getting the data from ajax
         },
        buttons: {
         'Continue': function() {
                $(this).dialog('close');
                var  plaincontentlength=0;
                var htmlcontentlength=0
                var defContent=$('#manualdefaultemailplain').val();
                var defHTMLContent=$('#manualdefaultemailhtml').val();
                var htmlcontent=$('#manualhtmlinput').val();
                var plaincontent=$('#manualplaininput').val();


                if(defContent==0){
                 plaincontentlength=plaincontent.length;
                 $('#manualplainsubmit').val(plaincontent);
                }else{
                 $('#manualplainsubmit').val('');
                }
                if(defHTMLContent==0){
                 $('#manualhtmlsubmit').val(htmlcontent);
                 htmlcontentlength=htmlcontent.length;
                }else{
                 $('#manualhtmlsubmit').val('');
                }
                var overridelength=plaincontentlength+htmlcontentlength;
                if(overridelength &gt;0){
                 $('#manualyes').show();
                 $('#manualno').hide();
                }else{
                 $('#manualyes').hide();
                 $('#manualno').show();
                }
         }

        }//end buttons

        });//end dialog

function getImages(worktype,div){

        ajaxGet('worktypes.php?ajax=yes&amp;worktype='+worktype,getImageCallback)


}

function getImageCallback(result){
        $('#manualimages').html(result);

}
</code></pre>
