成功コード>
callback
の名前です promise
ではなく関数 。
使用する必要があります:
$.ajax({
type: "POST",
url: "<?php echo site_url('con_product/ins_product'); ?>",
data: data,
success: function() {
alert("Products list is ready to be printed");
window.open("<?php echo site_url('con_product/print_product'); ?>","_blank");
window.open("<?php echo site_url('con_product/form_product'); ?>","_self");
}
});
またはdone
約束:
$.ajax({
type: "POST",
url: "<?php echo site_url('con_product/ins_product'); ?>",
data: data
}).done(function() {
alert("Products list is ready to be printed");
window.open("<?php echo site_url('con_product/print_product'); ?>","_blank");
window.open("<?php echo site_url('con_product/form_product'); ?>","_self");
});