lozina
Lifer
So I'm trying to get the contents of the dragged data object for some feature I wish to implement.
Basically I have a DIV on my page which I made to accept drag drops. I have a function that is supposed to then get the contents of that drop and when I test it with Firefox it works fine, but in IE it keeps returning "null" data.
Here is my DIV:
Here is my drop Event function:
So for both IE and Firefox, I get an Object output on the first alert.
But then for the next two alerts IE gives me "null" while Firefox gives me actual data for both.
What I am doing is I am dragging the url from the address bar of the browser into this DIV.
Any ideas what I need to do for IE?
Basically I have a DIV on my page which I made to accept drag drops. I have a function that is supposed to then get the contents of that drop and when I test it with Firefox it works fine, but in IE it keeps returning "null" data.
Here is my DIV:
Code:
<div id="target" onDrop="dropHandler(event)"></div>
Here is my drop Event function:
Code:
function dropHandler(event) {
alert('the data is '+event.dataTransfer);
alert('the url data is '+event.dataTransfer.getData("URL"));
alert('the text data is '+event.dataTransfer.getData("Text"));
}
So for both IE and Firefox, I get an Object output on the first alert.
But then for the next two alerts IE gives me "null" while Firefox gives me actual data for both.
What I am doing is I am dragging the url from the address bar of the browser into this DIV.
Any ideas what I need to do for IE?