Is it possible to drag and drop some content between two browser windows using JQuery or another method?

user1421214 picture user1421214 · May 28, 2012 · Viewed 15.1k times · Source

Basically, I have a popup window and I want ability to drag and drop an html item back to parent opener window. For example, if there is an image on the popup window which is draggable (and basically a handler only), once I drop it in the drop-zone of the parent window I just need to copy a hidden ID and/or maybe name of the Image from the popup to the parent window.

I can see plenty of examples on same page drag and drop but across windows? Is it possible? Both these windows have same website opened so I suppose there shouldn't be any cross-site issue thing?

Could you point me to the right direction? Anything not clear please ask.

EDIT

Is HTML5 an option?

Another EDIT

Is there another way to achieve above? i.e. different method than drag and drop - I am interested in transferring some data between one window to another here. Any ideas will be appreciated.

Answer

zupa picture zupa · Jun 13, 2012

You are after the HTML5 Drag and Drop API

A pretty good description: DnD Basics

You can even drag and drop stuff between Firefox and Chrome. Safari is missing the drop event, should be out in the next release (6 if I'm right). Opera & IE is not supporting it yet.