Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
How to print another page with a button using ajax

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!