Я использую SimpleModal в jQuery, и у меня есть один диалог подтверждения. Если результат 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();
});
}
});
}
Здесь у меня есть проблема с тем, как написать это же окно Confirmdialog из результата Ajax. Как мне это сделать?
Благодаря EMART для напомнить мне – venkatachalam
Возможно ли изменить размер нового диалога? – venkatachalam
Вы можете сделать что-то вроде: dialog.container.css ({height: "800px", width: "600px"}); –