jquery:javascript对话框只出现一次

时间:2011-12-16 15:33:25

标签: javascript jquery

此div [#divSaveAndDistribute]仅出现一次。我怎样才能让它在任何时候被触发?感谢

  pic1 = new Image(16, 16); 
pic1.src = "images/loader.gif";

$(document).ready(function(){


$("#save").live('click',function() {

//alert("you just clicked me");


var table="products_tb";         

$("#status").html('<img src="images/loader.gif" align="absmiddle">&nbsp;Checking empty fields...');
$("#dialog-confirm").dialog("open");

var dataString = 'table='+table;
    //alert(dataString);

    //$("#alert").fadeIn(200).html('<img src="images/load/ajax-loader.gif" align="absmiddle">');
    $.ajax({
        type: "POST",
        url: "checkEmpty.php",
        data: dataString,
        cache: false,

        success: function(html)
        {

// $(“#alert”)。fadeOut(200);

    // $(".confirm").easyconfirm();
        $("#status").html(html);

// $(“#pled”)。val(“”);

        }
    //clear_form_elements("form#CommentForm");

       });

    });

$( "#dialog:ui-dialog" ).dialog( "destroy" );

    $( "#dialog-confirm" ).dialog({
            autoOpen: false,
        resizable: false,
        height:200,
                    width:400,
        modal: true,
        buttons: {
            "check": function() {
                $( this ).dialog( "close" );
            },
            Cancel: function() {                        
                $( this ).dialog( "close" );
                //alert("you just offed me");
                $('#divSaveAndDistribute').show();
            }
        }
    });

1 个答案:

答案 0 :(得分:0)

它应该是完整的帮助:     $(“#dialog-confirm”)。dialog(“open”);     $(“#dialog-confirm”)。dialog(“close”);

在此网站的底部:http://jqueryui.com/demos/dialog/您有方法,事件和选项列表