We help IT Professionals succeed at work.

Can not close jquery UI diolog box

I am using jquery dialog box. And it pos up but I ca not close by clicking on the Ok button. Please help.

Here is my code

$(document).ready( function() {
             setTimeout("$('#linkClick').dialog('destroy');",1500);
             
            $("#linkClick").click( function(e){
                  e.preventDefault();
                  $("#content").load('index.html');
            
                  
                  $('#content').dialog({
                         
            resizable: true,
                  
                  modal: true,
                  closeOnEscape:false,
            draggable:true,
            scrollbars:false,
           
                  width: 660,
                  height: 400,
                         buttons: {
                        "OK": function() {
                                    alert('Hello');
                                $('#content').dialog("close");
                                                //$('#').dialog("close");
                                                $('#content').dialog('destroy')
                                                
                        },
                        "Cancel": function() {
                                $(this).dialog("close");
                        }
                }
            
                        
                  });
                  //alert('Hello');
                  
                  
                  });
            
      });
      
Comment
Watch Question

Commented:
"OK": function() {
    alert('Hello');
     $(this).dialog('close');
     $('#content').dialog('destroy');
}

Open in new window

erikTsomikSystem Architect, CF programmer

Author

Commented:
still no luck

Commented:
Post all of your code including HTML

Explore More ContentExplore courses, solutions, and other research materials related to this topic.