jQuery Ajax和对话框

below is my code for confirmation dialog and sending data with ajax.
In this code, the Delete button event under the first dialog is breaking the code and if I click the delete button nothing happens in page.
And if I remove the ajax code in Delete button event, there is no problem again.
I should send the data if I click the Delete button.
How can I fix the code, thanks for your helps.

$("input.delete").live("click", function(){
    $.ajax({
        type: "POST",
        url: "forms.php",
        cache: false,
        dataType: "json",
        data: {action: 'confirm', ntag: $('input.tag').val() == 'something' ? '' : $('input.tag').val()},
        success: function(data){
            $(".dialog p").html(data.message);
            var ids=data.ids;
            $(".dialog").dialog({
                resizable: true,
                width: 500,
                height: 200,
                modal: true,
                buttons: {
                    "Delete": function() {
                        $.ajax({
                            type: "POST",
                            url: "forms.php",
                            cache: false,
                            dataType: "html",
                            data: {action: 'delete', ntag: ids},
                            context: $(this),
                            success: function(data){
                                $(".dialog p").html("deleted!");
                                $(".dialog").dialog('open');
                            }
                        }
                    },
                    "Update": function() {
                        document.location.href='edit.php';
                    }, 
                    "Cancel": function() {
                        $( this ).dialog( "close" );
                    }
                }
            });
        }
    });
});

I believe you didn't close the open paren from

$.ajax({

(the one in your Delete: function)

/**
* @Author : Ahmad Nabulsi
* @Date : 5/5/2013
* @param myHref : url to get ajax
* @param divIdToUpdate : div tag id to return response in it
* 
*/ 


function ajax(myHref , divIdToUpdate){
    $.ajax({
        url: myHref,
        type: "GET",
        success: function(data) {

            $('#'+divIdToUpdate).html(data);
        }
    });
}
/**
* @Author : Ahmad Nabulsi
* @Date : 5/5/2013
* @param myHref : pass href of link ex: $(this).attr(href);
* @param title : title of dialog
* @param dialogId : dialog id to distinguish multi dialog opened at same time
* @param model : [true,false] to prevent interaction with parent until close dialog or not
* @param dWidth : [any number or 'auto']
* @param dHeight : [any number or 'auto']
* @param headerClass : css class name in order to change header style
* @param loaderImagTagId : to show loading image while ajax response returned
    create in main page <img src="/cakephp-1.3.0/garage_mysql/img/gif-load.gif" alt="loading" style="display:none;margin: 0 auto;" id="ajaxLoader" />
*   and pass the id of this tag ex : 'ajaxLoader'
* @returns {Dialog }
*/
function dialog(myHref, title ,dialogId ,model ,dWidth ,dHeight ,headerClass , loaderImagTagId){
    var imageLoader = $('#'+loaderImagTagId)[0].outerHTML;
    imageLoader = imageLoader.replace("none","block");
    var dialog = $( "<div id='"+ dialogId +"' title='"+ title +"' style='text-align:center;'>"+ imageLoader +"</div>" ).dialog({
        autoOpen: false,
        height: dHeight,
        width: dWidth,
        position: 'top',
        modal: model,
        open: function(event, ui) {
            $('ui-dialog-titlebar').addClass('headerClass');

        },
        beforeClose: function(event, ui) { 
               $('ui-dialog-titlebar').removeClass('headerClass');
        },
        close: function(){
            dialog.dialog('destroy').remove();
        }


    });

    dialog.dialog( "open" );

    ajax(myHref ,dialogId);
    return false;
}

/**
*  ****How to use****
*  1- create link in your page ex : 
* <a href="www.google.ps" onclick="dialog($(this).attr('href'),'my Title','myDialogId',true,'auto','auto','myCssClassName','imageLoaderId');return false;">Click Me</a>
* 
* 2- create Ajax Loader image in main page ex :
* <img src="/cakephp-1.3.0/garage_mysql/img/gif-load.gif" alt="loading" style="display:none;margin: 0 auto;" id="ajaxLoader" />
* Ajax Loader image sytle display :none in order to show just when ajax sent
* 
*/