0

我创建了这样的 jQuery UI 对话框:

$("<div></div>").dialog({
           autoOpen: true, //for info, true is default
           modal: true,
           title: ':' + Id,
           width: '340',
           minHeight: '200',

           open: function () {

           },
           close: function () {
               $(this).dialog('destroy');
           }
       });

在此,我想设置 OK 按钮,如果我按下 OK 按钮,它将通过以下 ajax 方法:

$.ajax({
            url: "Home.aspx/DeleteProject",
            type: "POST",
            dataType: 'json',
            contentType: 'application/json; charset=utf-8',
            data: "{'projectSoid': '" + Id + "'}",
            async: false,
            success: function (data) {

                if (data.d == "")
                {
                    ProjectCarousel();
                }
            },
            error: function (xhr) {
            }
        });
4

1 回答 1

0
$("<div></div>").dialog({
           autoOpen: true, //for info, true is default
           modal: true,
           title: ':' + Id,
           width: '340',
           minHeight: '200',
            buttons: {
           "Ok":function() {
                 callAjaxHere();
            }
           },    
           open: function () {

           },
           close: function () {
               $(this).dialog('destroy');
           }
于 2013-03-08T15:06:33.683 回答