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

245
Views
Mostrar un modal de carga después de confirmar la ventana emergente onbeforeunload

Estoy tratando de mostrar un modal de carga cuando el usuario va a otra página de mi sitio.

Dado que más de la mitad de las páginas son formularios, decidí mostrar la ventana emergente de forma predeterminada si el usuario no guarda sus datos. Aquí está el código javascript:

 $("input, textarea, select").bind('change', function() { $("button[type='submit']").click(function() { window.onbeforeunload = function() { return } }) window.onbeforeunload = function(evt) { var message = '?' var e = evt || window.event e.returnValue = message return message } }) $(document).ready(function() { $('form.modal-trigger').submit(function() { $('#submit-modal').show() }) window.onbeforeunload = function() { $('#submit-modal').show() } })

Cuando el usuario hace clic en Cancel , todo está bien, pero cuando selecciona OK , mi modal no se muestra.

¿Hay alguna forma de mostrarlo después de que el usuario seleccione OK ?

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!