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

120
Vistas
JavaScript Scopes inside inline event handlers

I am trying to execute a function which is dynamically fetched, but I am getting an undefined error. I think it probably has something to do with scope but I don't know the exact problem.

This is code.

<button onmouseover="function load_script(){import('/script.js')};load_script()" onclick="checker()">Click

The script file is located at root and has these contents.

export const checker = () => console.log(2020);

The browser does fetch the script upon mousehover but it cannot find the function checker on click event which makes me think this problem is related to scope but I can't resolve it.

Any ideas?

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