new DataReceiver()
Instance created by DataTransfer. An object of this class is created by
DataTransfer and set to the member dataReceiver.
The instance of this class can be obtained by calling {DataTransfer.getReceiver()}.
- See:
Events
-
onMessage
-
Event handler called when a raw data object is received by the data channel of the DataTransfer object. Application should override this function to handle the received data by itself. If it is not overridden by the application, the received raw data object cannot be passed to the application to handle it.
Parameters:
Name Type Description evt
Object The event object received by the data channel. It is passed to the function complete and unmodified. The raw data can be fetched by evt.data and supports the following data types:
- Text string
- BLOB raw data
- ArrayBuffer
- ArrayBufferView
Example
var receiver = dataTransfer.getReceiver(); receiver.onMessage = function(evt) { var rcvdDataElm = document.getElementById("rcvData"); rcvdDataElm.value = evt.data; }