[EMAIL PROTECTED] wrote:
> Hi,
>
> Using jqModal, if I define that my dialog load its contents through ajax
>
>                 $('#editPanelTitle').jqm({trigger: '#editTitle1',
>                                           focus: true,
>                                           overlayColor: '#fff',
>                                           overlay: 30,
>                                           ajax: "panel_title.html"},
>                                          function(h) {
>                                             /* do stuff */
>                                          });
>
>
> how do I invoke a JS function once the ajax contents have been loaded?  The 
> "onOpen" argument of the jqModal doesn't seem to work because I'm not 
> guaranteed the ajax call will be loaded.
>
> Thanks, - Dave
>   
Dave,

  You can handle this in two ways.

1) Include javascript in your ajax response. It will get evaluated.

2) Use a customized AJAX routine in the onOpen callback.

e.g.

$('#editPanelTitle').jqm(
        {
        trigger: '#editTitle1',
        focus: true,
        overlayColor: '#fff',  /* DEPRICATED -- see overlayClass parameter */
        overlay: 30,
        },
        function(h)  /* onOpen function */
        {
                /* perform remote load IN onOpen */
                h.w.load('panel_title.html',function()  /* ajax callback */
                { 
                // script to be evaluated after ajax return
                ...
                }
        }
);

Hope this makes sense. See the note regarding overlayClass (if you're using 
jqModal r5 or r6)

~ Brice



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to