Simple modal in jQuery

前端 未结 2 1695
时光取名叫无心
时光取名叫无心 2021-01-14 23:19

I am using SimpleModal in jQuery, and I have one confirm dialog. If the result is Yes, I have to call my.php into this dialog. However, I have done

2条回答
  •  不知归路
    2021-01-14 23:53

    I'm not sure what you are trying to accomplish -- are you trying to reuse the confirmation modal dialog to display your results? I suppose you could do this, given that you have a "close X" button on the dialog by simply replacing the contents of the message with your results and removing the buttons so your callback doesn't get fired again. It might look something like this:

     dialog.data.find('.message').html( 'new contents from your ajax data' );
     dialog,data.find('.buttons').remove();
    

    However, this seems like an abuse of a modal dialog to me. In my opinion, the dialog should only contain a single interaction with the user. If you need further interaction based on the results of your initial dialog, then I would consider either adding another modal dialog that you pop up after the current one is closed with your AJAX results or insert the AJAX results into your main interface and deal with it there.

提交回复
热议问题