binaryType
Summary
Indicates the type of binary data being transmitted by the connection.
Property of apis/websocket/WebSocketapis/websocket/WebSocket
Syntax
var result = element.binaryType;
element.binaryType = value;
Return Value
Returns an object of type StringString
Examples
socket.binaryType = "blob";
// receive some blob data
socket.binaryType = "arraybuffer";
// now receive ArrayBuffer data
Notes
Acceptable values are “arrayBuffer” and "blob".
Related specifications
- W3C WebSocket Specification
- W3C Candidate Recommendation
Attributions
Mozilla Developer Network : Article
Microsoft Developer Network: Windows Internet Explorer API reference Article