Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Drag and Drop event handlers for Firefox  RSS feed

Abhishek Asthana
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I need to implement drag and drop across frames and I tried using the latest Drag And Drop event handlers (in Firefox 3):
ondrag, ondragstart, ondragenter, ondragover etc. but nothing works.

My code is simple one:

This code should give an alert when one tries to drag the image. But absolutely nothing happens!

The example given on also doesn't seem to work. (The image never gets dragged anywhere!)

On this page: the documentation says that ondragstart "is the HTML 5 spec name for the event and may be used in HTML or XUL handlers will work for both HTML and XUL."

The documentation says: "There are two ways that drag and drop events can be handled. This first involves using the drag and drop XPCOM interfaces directly. The second is to use a JavaScript wrapper object that handles some of this for you."

I am very confused with this. Can someone please tell me how to do drag and drop using these event handlers?

Any pointers/examples will help.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!