簡體   English   中英

jQuery:JavaScript對話框僅出現一次

[英]jquery : javascript dialog box appears only once

該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();
            }
        }
    });

應該是完整的幫助:$(“#dialog-confirm”).dialog(“ open”); $(“#dialog-confirm”).dialog(“ close”);

在此網站的底部: http : //jqueryui.com/demos/dialog/ ,其中包含方法,事件和選項的列表

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM