Ajax call with html returned to a dialog box

Ajax call with html returned to a dialog box

Hi all,

I'm having trouble getting this to work. Can somebody please verify my code? I have this function set as an onclick on a text link. When I execute the function It shows in the div but it does not pop up the dialog box. Thanks all.

function mhistory(){
            $.ajax({
                 type: "GET",
                 url: "request_history.jsp",
                 dataType: "html",
                 success: function(html){
                   $("#dialog2").html(html);
                   var e = $("#dialog2").dialog({
                      title:"History"                     
                     });
                  
                   e.dialog( 'open' );
                 }
               });

            
         }