views:

9

answers:

1

I have various html links on a page that I want to drag into another page/window using the ondrop event. While I expect to modify the objects being created on the new page, the example below is likely good enough to show what I am after.

How do I prevent firefox from simply loading the URL I am dropping in the page?

I was hoping to use something like this:

$(document).bind('ondrop', function(ev){
    $(document).append( $("<A>").attr('href',event.data.href) );
    return false; // prevent event from bubbling up?
});

Note that the hyperlinks are not in the same window (perhaps not in the same browser?) and are not under jQuery control. They are usually just hyperlinks (is firefox the only browser that allows dragging of links into other windows?)

I realize that the above may not even be close to valid jQuery... Any pointers appreciated.

A: 

It would appear that this link works between separate firefox windows and even between firefox and chrome

http://hacks.mozilla.org/2009/07/html5-drag-and-drop/

ericslaw