Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

284
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!