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.
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.