Jquery Dialog Ok button is not working firefox but working in IE
<p>I am opening a dialog box with a button click event. Dialog box contains ok and cancel button. In IE it works normaly but in firefox dialog is opening 'cancel' button is working but 'ok' button nothing is happening. </p>

<p>Below is the code of a button in which i am opening a dialog.</p>

<pre><code>$('#addImage').click(function ()
{
    var url = 'Default.aspx'; 
    var d = $('#dialog_img').html('&lt;iframe id="ifrm" , width = 540 , height = 170&gt;&lt;/iframe&gt;');
    $("#dialog_img&gt;#ifrm").attr("src", url);
    d.dialog('open').dialog({ modal: true ,width: 560,resizable: false , 
        buttons: 
        {
            'OK': function() {
                 var img = document.createElement('img');
                $(img).attr("id", "dyndiv" + count);
                $(img).attr("width", 30);
                $(img).attr("height", 50); 
                $(img).attr("src", 'Uploads/'+window.frames['ifrm'].document.getElementById('dvFileName').innerHTML) ;
                var $ctrl = $(img).resizable({ containment: '#containment-wrapper'}).parent().addClass("resizable mydiv").draggable({
                    containment: '#containment-wrapper',
                    cursor: 'move',
                    delay: 200,
                    distance: 30,
                    opacity: 0.35
                })
                objid = "dyndiv" + count;
                $(img).css("z-index" , $(img).css("z-index") + count );
                $('#sel_obj_text').val("Image");
                image_visibility();
                count++; 
                $("#containment-wrapper").append($ctrl);
                $('#' + objid).parent().css("position","relative"); 
                $('#' + objid).parent().position({
                    of: $( "#containment-wrapper" ),
                    my: "center" + " " + "center",
                    at: "center" + " " + "center"
                });                   

                $(this).dialog('destroy');
            },
            'Cancel': function() {
                $(this).dialog('destroy');
            }
        }
    });
}); 
</code></pre>
