When I start to drag a div to drop it in another div on the same page, it fails with the message:
"Uncaught DOMException: The operation is insecure.
dragstart_handle… (read more)
When I start to drag a div to drop it in another div on the same page, it fails with the message:
"Uncaught DOMException: The operation is insecure.
dragstart_handler http://127.0.0.1:5000/main.js:7"
This is main.js:
```
function dragstart_handler(event) {
var t = event.target;
while (! t.draggable == "true" && t.tagName != "BODY") {
t = t.parentNode;
};
if (! t.draggable) return;
event.dataTransfer.setData("application/x-moz-node", t);
...
```
All dragging goes inside the same document, so "The operation is insecure" shouldn't happen.
Also I get an empty string when trying to get the draggable data:
```
function drop_handler(event) {
var t = event.target;
const parent = t.parentNode;
if (parent.id == "drag_area") {
event.preventDefault();
const data = event.dataTransfer.getData("application/x-moz-node");
Here's how I assign draggables and drop areas:
```
window.addEventListener("DOMContentLoaded", () => {
const dragArea = document.getElementById("drag_area");
dragArea.addEventListener("dragstart", dragstart_handler);
dragArea.addEventListener("dragover", dragover_handler);
dragArea.addEventListener("dragleave", dragleave_handler);
dragArea.addEventListener("drop", drop_handler);
});
```
HTML:
```
```