dataTransfer.setData() and .getData() commands in FireFox?

Discussion in 'Javascript' started by dwhalen, Jan 29, 2007.

  1. dwhalen

    dwhalen Guest

    Hi Everyone.

    I'm new to drag-and-drop, and I'm running into a problem getting some
    code I found to work in FireFox. I have a third-party Tree control
    that accepts droppable items that implement the setData and getData
    methods. In IE6/7
    the following code is draggable:

    <img src="Images/TreeIcons/file.gif" border="0"
    onDragStart="event.dataTransfer.setData('text', '2|16|190');" />

    I'm able to drag it right onto the tree and get the needed value "2|16|
    190"

    When I load the same code in Firefox I can't get the image to drag at
    all, and therefore I don't know if it'll even
    drop. If I can get it to drop, I need to be sure I can use
    dataTransfer.getData()

    Can anyone point me in the right direction to get this working?

    Thanks so much!
    dwhalen, Jan 29, 2007
    #1
    1. Advertising

  2. dwhalen wrote:

    > <img src="Images/TreeIcons/file.gif" border="0"
    > onDragStart="event.dataTransfer.setData('text', '2|16|190');" />


    > When I load the same code in Firefox I can't get the image to drag at
    > all, and therefore I don't know if it'll even
    > drop. If I can get it to drop, I need to be sure I can use
    > dataTransfer.getData()



    ondragstart and event.dataTransfer are currently supported by IE only I
    think. Mozilla does not support that.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jan 29, 2007
    #2
    1. Advertising

  3. dwhalen

    dwhalen Guest

    Is there a way to hot-wire such code? For example, if I can get the
    drag to actually
    go, then I can maybe take it from there.

    I see a lot of examples of people that can get stuff to drag in
    Firefox, but I can't make
    any of them work for some reason. I know that Firefox doesn't support
    it, but surely
    a workaround is possible....

    Thanks!

    On Jan 29, 1:33 pm, Martin Honnen <> wrote:
    > dwhalen wrote:
    > > <img src="Images/TreeIcons/file.gif" border="0"
    > > onDragStart="event.dataTransfer.setData('text', '2|16|190');" />
    > > When I load the same code in Firefox I can't get the image to drag at
    > > all, and therefore I don't know if it'll even
    > > drop. If I can get it to drop, I need to be sure I can use
    > > dataTransfer.getData()ondragstart and event.dataTransfer are currently supported by IE only I

    > think. Mozilla does not support that.
    >
    > --
    >
    > Martin Honnen
    > http://JavaScript.FAQTs.com/
    dwhalen, Jan 30, 2007
    #3
  4. dwhalen

    RobG Guest

    On Jan 31, 4:25 am, "dwhalen" <> wrote:
    > Is there a way to hot-wire such code? For example, if I can get the
    > drag to actually
    > go, then I can maybe take it from there.


    Please don't top-post here, reply below trimmed quotes.


    > I see a lot of examples of people that can get stuff to drag in
    > Firefox, but I can't make
    > any of them work for some reason. I know that Firefox doesn't support
    > it, but surely
    > a workaround is possible....


    There are many "draggable" libraries out there, here's a few that work
    well in modern browsers:

    YAHOO! UI
    <URL: http://developer.yahoo.com/yui/dragdrop/ >

    FORK
    <URL: http://forkjavascript.org/drag/tests >

    WalterZorn
    <URL: http://www.walterzorn.com/dragdrop/dragdrop_e.htm >


    --
    Rob
    RobG, Jan 30, 2007
    #4
  5. dwhalen

    Xavier Guest

    >
    > There are many "draggable" libraries out there, here's a few that work
    > well in modern browsers:
    >
    > YAHOO! UI
    > <URL: http://developer.yahoo.com/yui/dragdrop/ >
    >
    > FORK
    > <URL: http://forkjavascript.org/drag/tests >
    >
    > WalterZorn
    > <URL: http://www.walterzorn.com/dragdrop/dragdrop_e.htm >


    But these libraries do not implement "drag and drop" but merely "select and
    move",
    which is a very different thing that won't allow you to go beyond the
    boundaries of the document that holds the elements to be dragged...

    Xavier
    Xavier, Feb 22, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Piotrek
    Replies:
    7
    Views:
    19,342
    robwafle
    Aug 15, 2006
  2. Ben Pfaff

    Re: man pages for C commands (GCC commands)

    Ben Pfaff, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    3,952
    Thomas Stegen
    Jun 28, 2003
  3. Tim Stanka
    Replies:
    1
    Views:
    785
    Jeff Epler
    Aug 2, 2004
  4. Peter
    Replies:
    1
    Views:
    136
    David Mark
    May 13, 2010
  5. Tom de Neef

    clipboardData.setData

    Tom de Neef, Feb 24, 2011, in forum: Javascript
    Replies:
    0
    Views:
    561
    Tom de Neef
    Feb 24, 2011
Loading...

Share This Page