Drag-and-Drop in IE

A

Ari Krupnik

I'm working on a web-based bookmarking application. I want to let
people record an excerpt from a page, the page's URL and document
title by dragging and dropping selections from external pages. I know
how to do this in XUL, sort of, but haven't figured out a way to do
this in IE yet. Since this is going way beyond "normal" JavaScript,
I'm fine with bifurcating this part of the code into IE/Mozilla forks,
but I would like to avoid forcing my users to download a plugin.

If I could get access to HTML nodes from the external page and its
selection range, I'd have all I need. I could copy over the nodes, and
if I queried their ownerDocument property, I could find the location
(URL) and document title. I don't know of a way to do that in IE.

I put together a small page of my attempts at
http://deb.lib.aero/ari/jeteye/dnd.html

Here's what I've tried so far: I can handle "ondrop" event on my
page. In the handler, I can query event.dataTransfer.getData("text")
and .getData("URL"). This gives me no access to DOM information - only
plain text. I lose all formatting, and I have no access to document
properties such as title and location.

I can drop things into editable divs (contenteditable="true"). This
copies over nodes with formatting. including images, but still gives
me no access to source document information.


Ari.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top