Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
onload firing before script is loaded—but only on older iPads

I am doing some dynamic loading of external js files, like so:

const loadFile = (path) => {
    let script = document.createElement("script");
    script.type = "text/javascript";
    script.onload = () => {
       // some stuff
    };
    script.src = path;
    document.body.appendChild(script);
}

It works as expected in everything I've tested except older iPad models (earliest is iPad 6); on these devices, onload fires before the script is even loaded, and so nothing inside the function works.

While Googling this issue, I've tried:

  1. Reordering the onload function
  2. Changing onload to addEventListener for the load event
  3. Checking randomly in the DOM for an offset value

Among other solutions. Any other ideas would be greatly appreciated!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda