Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > dataTransfer.setData() and .getData() commands in FireFox?

Reply
Thread Tools

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

 
 
dwhalen
Guest
Posts: n/a
 
      01-29-2007
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!

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      01-29-2007
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/
 
Reply With Quote
 
 
 
 
dwhalen
Guest
Posts: n/a
 
      01-30-2007
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 <(E-Mail Removed)> 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/


 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      01-30-2007
On Jan 31, 4:25 am, "dwhalen" <(E-Mail Removed)> 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



 
Reply With Quote
 
Xavier
Guest
Posts: n/a
 
      02-22-2007
>
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How can I change the default Language Firefox uses for File and Menu Commands? Just aFax MAm Firefox 1 11-06-2005 05:45 PM
Need Help Differentiating Bad Commands From Incomplete Commands Tim Stanka Python 1 08-02-2004 02:08 AM
CGI and root commands gusmeister Perl 1 06-12-2004 06:28 PM
aaa Enable NEW access control commands and functions John Finch Cisco 2 12-01-2003 09:36 AM
Re: man pages for C commands (GCC commands) Ben Pfaff C Programming 4 06-28-2003 06:21 PM



Advertisments