I want to do something like Object.prototype.dataTransfer = new DataTransfer();
, but I want every new object to have it's own dataTransfer
. How do I do this?
For example, if I do
var a = new Object(); var b = new Object(); Object.prototype.dataTransfer = new Object(); a.dataTransfer.prop = 1; b.dataTransfer.prop = 2;
I want a.dataTransfer.prop
to still be 1, not 2.
For context, I'm trying to hack WebKit and IE so that the .dataTransfer object of the drag and drop events works appropriately.