我在jQuery中使用SimpleModal,並且我有一個確認對話框。如果結果是Yes
,我必須在此對話框中調用my.php
。但是,我已經完成了代碼,而且我仍然在尋找想法。我該怎麼做?jQuery中的簡單模態
$(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。我該怎麼做?
感謝易買得的提醒我 – venkatachalam 2008-12-29 04:40:02