It would seem that if this event has some clipboardData property attached to it (it can be nested in the originalEvent property). clipboardData contains an array of elements, and each of these elements has a getAsString() function that you can call. This returns a string representation of what is in the element.
These elements also have a getAsFile() function, as well as some other browser-specific ones (for example, in webkit browsers, there is a webkitGetAsEntry() function).
For my purposes, I needed the string value of what is being inserted. So, I did something similar to this:
$(element).bind("paste", function (e) { e.originalEvent.clipboardData.items[0].getAsString(function (pStringRepresentation) { debugger;
You want to iterate through the elements, preserving the result of concatenating the string.
The fact that there is an array of elements makes me think that it will take more work analyzing each element. You will also want to do some null-value checks.
Chandler Zwolle Sep 23 '14 at 15:05 2014-09-23 15:05
source share