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

285
Vistas
How do I use drag events (dragover) in a #document embeded in an <object> tag?

An HTML file that I created is being displayed in an HTML object on the parent page. I am creating some drag events on my page and they work fine when calling my html file directly. But, when displayed inside an HTML <object> , the drag events (specifically trying dragover), do not fire, even though I see them listed in my event listeners. During my troubleshooting, I noticed this is not an issue when showing the page inside an <iframe>.

I don't have the option to me to use <iframe>, is there something I can do to allow the dragover event when displayed through the object tag?

<html>
  <head>

  </head>
  <body>
    <iframe frameborder="0" width="100%" height="100%" src="mytest.html"></iframe>
    <object width="100%" height="100%" data="mytest.html"></object>
  </body>
</html>
document.addEventListener("dragover", function(event) {
  event.preventDefault();
  dragovertest();
});

function dragovertest(){
  alert("popup");
}
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