I wonder how to print another page without need to go the certain page that I need to print with a button.
I have a page called Receipts I already have Print button in it. On click to the print I want to print another page called Print.php which is there.
Here is my Ajax code:
// Update bill status and print
$(document).on('click', '.update_status', function(e){
e.preventDefault();
var ordernum=$(this).data("id");
$.ajax({
url:"pages/UpdateBillStatus.php",
method:"POST",
data:{ordernum:ordernum},
success:function(data){
document.getElementById('status'+ordernum).innerHTML = data;
// This is the part that I wrote but it still open the Print.php page then print
var printWindow = window.open('http://localhost/LaLigaCafe/pages/Print.php?ordernum='+ordernum+'');
printWindow.print();
}
});
});
So what I need is printing the page without need to going there just printing in my current page.
Thanks in advance guys.