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

189
Views
El evento onafterprint solo funciona una vez

Necesito llevar a cabo mi propio procedimiento después de llamar a la función de impresión del navegador. El problema es que solo lo ejecuta una vez.

¿Qué puedo hacer para que el evento onafterprint siempre se ejecute?

 window.onafterprint = function() { location.href = '{% url 'logout_' %}'; } Swal.fire({ title: 'Example', showDenyButton: true, showCancelButton: true, confirmButtonText: 'Yes', confirmButtonColor: 'green', denyButtonText: 'No', cancelButtonText: 'Cancel' }).then((result) => { if (result.isConfirmed) { flPrint = true; } else if (result.isDenied) { flPrint = false; } if ((result.isConfirmed) || (result.isDenied)) { $.ajax({ url: '{% url 'ajax-view' %}', dataType: 'json', contentType: "application/json", type: 'GET', success: function(r) { if (r.result) { if (flPrint) { window.print(); } else { location.href = '{% url 'logout_' %}'; } } }, error: function(err) { console.log(err); } }); } })
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!