success
je název callback
funkci a ne promise
.
Měli byste použít:
$.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");
}
});
Nebo done
slib:
$.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");
});