我不确定/confirm/i函数是否最适合您的需求,但类似的方法应该可以工作:
function confirm(message, callback) { $('#/confirm/i').modal({ close:false, position: ["20%",], overlayId:'/confirm/iModalOverlay', containerId:'/confirm/iModalContainer', onShow: function (dialog) { dialog.data.find('.message').append(message); // If the user clicks "yes" dialog.data.find('.yes').click(function () { $.get("my.php", function (data) { var resp = $("<div/>").append(data); var title = resp.find("#title").html(), message = resp.find("#message").html(); dialog.data.find(".header span").html(title); dialog.data.find(".message").html(message); dialog.data.find(".buttons .yes").hide(); dialog.data.find(".buttons .no").html("Close"); // No need to call the callback or $.modal.close() }); }); } });}


