Main Page

Drag and Drop

Drag and Drop
One of the biggest improvements in computer usability was the proliferation of drag-and-drop
behavior, allowing users to drag something from one spot on the screen and drop it somewhere
else to either create an action or simply move the item. This paradigm, developed by XEROX, was
first incorporated into consumer technology in Mac OS 1.0 and since that time has been incorpo-
rated in most personal computer operating systems (including Windows). When Dynamic HTML
was first introduced, developers around the world starting experimenting with drag-and-drop
functionality using JavaScript.
Drag and drop
is a buzzword in usability, so adding this functionality to your Web site or Web
application can win major points with customers and clients. At present time, you can accomplish
drag and drop in two ways using JavaScript: system drag and drop and simulated drag and drop.
System Drag and Drop
System drag and drop is what you probably do on a daily basis when using your Windows,
Macintosh, or other graphical operation system: You drag something from one area of the screen
and drop it somewhere else. To delete a file, you drag it to the trash (Macintosh) or the recycle bin
(Windows); to move a file from one folder to another, you just drag the file from where it is and
drop it into its new home. System drag and drop works because it has help from the operating sys-
tem to complete its task. Currently, only one Web browser on one platform supports system drag
and drop in Web pages, and that is Internet Explorer on Windows (although Mozilla supports it in
XUL-based pages).
A system drag and drop can move in between windows and frames because the drag action is
handled by the operating system. You can drag an image from a Web browser onto your desktop
or into another browser. When you drag it onto your desktop, you download the image; when you
drag it into another browser, the browser displays the image. The communication between the
browser and the desktop (or other browser) is handled by the operating system.
16_579088 ch13.qxd 3/28/05 11:40 AM Page 387

JavaScript EditorFree JavaScript Editor     Ajax Editor