JavaScript语言参考手册_事件和事件句柄

JavaScript

 
 JavaScript手册 
目录
此参考中包含
的内容
轻松上手
简介
操作符
语句
核心
文档
窗口
表单
浏览器
事件和
事件句柄
LiveWire
数据库服务
进程管理服务
实用工具
全局函数
LiveConnect
的Java包
索引
版权
 
【目录】 【上一页】 【下一页】 【索引】

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.

事件适用对象Window
实现版本Navigator 4.0

语法

onDragDrop="handlerText"

参数

handlerTextJavaScript 代码或对一个 JavaScript 函数的调用。

使用的事件属性

type标明了事件的类型。
target标明了事件原来发送的对象。
dataReturns an Array of Strings containing the URLs of the dropped objects.
modifiersContains the list of modifier keys held down when the event occurred.
screenX,
screenY
Represent the cursor location at the time the event occurred.

安全性

Getting the data property of the DragDrop event requires the UniversalBrowserRead privilege. 要获取 Navigator 4.0 中关于安全性更多的信息,请看“JavaScript 指南”中的第七章“JavaScript 安全性”

描述

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事件适用对象the DragDrop event returns true, the browser loads the item normally. If the event handler returns false, the drag and drop is canceled.

参看

要获得关于事件句柄的常规信息,请看“事件的常规信息”

要获得关于事件对象的信息,请看事件


【目录】 【上一页】 【下一页】 【索引】

回页面顶部