<html>
<head>
<title>System Drag And Drop Example</title>
<script type="text/javascript">
function handleDragDropEvent(oEvent) {
switch(oEvent.type) {
case "dragover":
case "dragenter":
oEvent.returnValue = false;
break;
case "drop":
alert(oEvent.dataTransfer.getData("URL"));
}
}
</script>
</head>
<body>
<P>Try dragging the link to the red square.
It will show you the URL when dropped.</p>
<P><a href="http://www.java2java.com">www.java2java.com</a>
<input type="text"
ondragenter="handleDragDropEvent(event)"
ondragover="handleDragDropEvent(event)"
ondrop="handleDragDropEvent(event)"></div></p>
</body>
</html>
|