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

203
Vistas
Popup window loses reference on page reload

I'm opening a popup window with javascript and, when it loads, I have bind some events to the loaded content.

But, if user clicks a link, submit a form or do something else (inside the popup) that changes popup location, I would need to rebind those events. Tried to do like this:

const _popup = window.open(
    '...',
    null,
    "scrollbars=no; width=1024px; height=768px"
);
_popup.onload = function(){
    //bind events...
    //do stuff...
};

Instead of rerun the _popup.onload function, it loses reference and I can't rebind them.

Also tried: _popup.addEventListener('load', function(){ /*...*/ });. But the result is the same.

How would I attach an event to the popup window that will run even if it's location changes?

about 4 years ago · Santiago Gelvez
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