jQuery で SimpleModal を使用しており、確認ダイアログが 1 つあります。結果が の場合、このダイアログYes
を呼び出さなければなりません。my.php
ただし、コードを作成しましたが、まだアイデアを探しています。どうすればいいですか?
$(document).ready(function () {
$('#confirmDialog input.confirm, #confirmDialog a.confirm').click(function (e) {
e.preventDefault();
// Example of calling the confirm function.
// You must use a callback function to perform the "yes" action.
confirm("Continue", function () {
alert("OK");
});
});
});
function confirm(message, callback) {
$('#confirm').modal({
close:false,
position: ["20%",],
overlayId:'confirmModalOverlay',
containerId:'confirmModalContainer',
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){
// Create a modal dialog with the data.
// Here: How do I write the same window?
});
// Call the callback
// Close the dialog
$.modal.close();
});
}
});
}
ここで、Ajax の結果から同じウィンドウの Confirmdialog をどのように記述するかという問題があります。どうすればいいですか?