ajax イベントが成功した後にダイアログ ウィンドウを開く方法を見つけるのに苦労しています。現時点では、jquery .html を使用して html を div に挿入していますが、標準の div という名前の代わりに、html を使用してダイアログ ウィンドウを作成したいと考えています。これは、値が変化するため、標準的な応答では対応できないためです。これは可能ですか?
私のサンプルコードの div; #dialog-message は単なる例です。ありがとう
jquery+ダイアログコード
//Begin function to submit report form
$(function () {
$("#frmreport").submit(function () {
var send = $(this).serialize();
$.ajax({
type: "POST",
url: "/sample/admin/frm10010.php",
data: send,
dataType: "json",
success: function (msg) {
$("#confirm_department").hide();
$(function () {
$("#dialog-message").dialog({
modal: true,
buttons: {
Ok: function () {
$(this).dialog("close");
}
}
});
});
//alert('You have succesfully submitted your '
// + msg.dept + ' report. Thank you.');
//$("#report_result").html("You have succesfully
// submitted your report. Thank you."+"<br /><br />");
$("#formShow").hide();
$("#formImage .col_1 li").show();
$("#frmreport").get(0).reset();
}
});
return false;
});
});
// End function to submit report form