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

204
Vistas
How do I control timing of javascript execution in relation to other scripts loading dynamic content?

I've created a small piece of javascript to target some dynamically loaded HTML from a plugin script (YOTPO Reviews).

<script type="text/javascript">
if(window.location.hash) {
    document.getElementsByClassName('write-review-wrapper')[0].style.display = "block";
}
</script>

I'm running into 'x is not defined' type errors and I assume this is because my script is running before the Yotpo widget script has finished loading the HTML I'm selecting?

I know I can execute the script after the DOM has loaded with the window.onload state and this works, however because I've got so many other scripts that are taking time to load in, such as live chat, tracking etc. It's too slow and what I'm trying to achieve becomes somewhat pointless.

The YOTPO script loads in an acceptable time, but how can I get my script to execute just after it's loaded (if that is indeed the issue here)?

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