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

212
Views
Problema al usar eventos de carga en Firefox y Safari

Tanto Firefox como Safari se niegan a ejecutar el evento de load cuando se cargan desde un archivo js externo. Solo funciona en google chrome.

Realmente no puedo entender el problema.

en mi html:

 <script src="/assets/js/pages/myFile.js" type="text/javascript"></script>

en myFile.js :

 window.addEventListener("load", function(event){ // do someting (only works in chrome browser) })

Mi página html está servida por node.js (página ejs), myFile.js es reconocido por los 3 navegadores (Firefox, Chrome y safari), por lo que realmente no entiendo por qué mi evento de carga falla con ff y safari.

También probé window.unload sin éxito.

Cualquier sugerencia ?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Parece que el evento ya se disparó, te sugiero que siempre lo verifiques:

 function onLoad(callback){ if (document.readyState === 'complete') { callback(); } else { window.addEventListener("load", callback); } } onLoad(function(){ // do someting });
about 4 years ago · Santiago Trujillo Report
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!