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

140
Views
Cómo deshabilitar o personalizar el mensaje predeterminado en la alerta que muestra para detener la página existente sin guardarla

Estoy trabajando en reaccionar JS. Necesito deshabilitar o personalizar el mensaje predeterminado "Es posible que los cambios realizados no se guarden". He usado el código que se muestra a continuación, pero no hay cambios en el mensaje predeterminado. Alguien puede ayudar a resolver el problema.

Código utilizado para personalizar el mensaje emergente

 useEffect(() => { return () => { window.addEventListener("beforeunload", function(e) { let confirmationMessage = "'It looks like you have been editing something. "; (e || window.event).returnValue = confirmationMessage; //Gecko + IE formRegistered && handleSubmit(e) console.log(" confirmationMessage", confirmationMessage) return confirmationMessage; //Webkit, Safari, Chrome }); } });

código utilizado para deshabilitar la ventana emergente

 useEffect(() => { return () => { window.addEventListener("beforeunload", function(e) { let confirmationMessage = "/o "; (e || window.event).returnValue = confirmationMessage; //Gecko + IE formRegistered && handleSubmit(e) console.log(" confirmationMessage", confirmationMessage) return null; //Webkit, Safari, Chrome }); } }); [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/wWyjJ.png
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!