- format [in]
A String that specifies one of the following data format values.
Variant of type String. Returns the data in the format retrieved from the clipboard through the dataTransfer object or the clipboardData object. Depending on the information contained in setData, this variable can get a path to an image, text, or an anchor URL.
There are no standards that apply here.
The getData, setData, and clearData methods have all been deprecated in Microsoft Edge, in favor of the add, remove, and clear methods of the DataTransferItemList object. You can access the DataTransferItemList from the DataTransfer.items property.
The getData method enforces cross-frame security and allows data transfers only in the same domain. To the user, this means that a selection that is dragged between different security protocols, such as HTTP and HTTPS, fails. In addition, that a selection that is dragged between two instances of the application with different security levels, where the first instance is set to medium and the second is set to high, fails. Finally, that a selection that is dragged into the application from another drag-enabled application, such as Microsoft Word, also fails.
This example uses the getData method to drag text and drop it in a new location.
This example uses the getData method to create a desktop shortcut using a drag-and-drop operation.