开发者

using javascript ondrop to add to a page rather than replace-tab in firefox?

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 rea开发者_JAVA百科lize that the above may not even be close to valid jQuery.


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜