[Contents] [Previous] [Next] [Index]

onDragDrop

Executes JavaScript code when a DragDrop event occurs; that is, when the user drops an object onto the browser window, such as dropping a file.

Event handler for

Window

Implemented in

Navigator 4.0

Syntax

onDragDrop="handlerText"

Parameters

handlerText
JavaScript code or a call to a JavaScript function.

Event properties used

type
Indicates the type of event.

target
Indicates the object to which the event was originally sent.

data
Returns an Array of Strings containing the URLs of the dropped objects.

modifiers
Contains the list of modifier keys held down when the event occurred.

screenX,
screenY
Represent the cursor location at the time the event occurred.

Security

Getting the data property of the DragDrop event requires the UniversalBrowserRead privilege. For information on security in Navigator 4.0, see Chapter 7, "JavaScript Security," in the JavaScript Guide.

Description

The DragDrop event is fired whenever a system item (file, shortcut, and so on) is dropped onto the browser window using the native system's drag and drop mechanism. The normal response for the browser is to attempt to load the item into the browser window. If the event handler for the DragDrop event returns true, the browser loads the item normally. If the event handler returns false, the drag and drop is canceled.

See also

For general information on event handlers, see "General Information about Events".

For information about the event object, see event.


[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 16:34:02


Copyright � 1997 Netscape Communications Corporation