• Skip to main content
  • Skip to search
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web 开发技术
  2. Web API 接口参考
  3. WebSocket
  4. WebSocket.binaryType
  • Change language
  • View in English

Table of contents

  • 语法
  • 返回值
  • 规范
  • 浏览器兼容性

WebSocket.binaryType

WebSocket.binaryType 返回websocket连接所传输二进制数据的类型。

语法

var binaryType = aWebSocket.binaryType;

返回值

 一条DOMString:

"blob"
如果传输的是 Blob 类型的数据。
"arraybuffer"
如果传输的是 ArrayBuffer 类型的数据。

 

规范

Specification Status Comment
HTML Living Standard
WebSocket: binaryType
Living Standard Initial definition

浏览器兼容性

BCD tables only load in the browser

Last modified: Oct 15, 2020, by MDN contributors

Change your language

Related Topics

  1. WebSocket
  2. Constructor
    1. WebSocket()
  3. 属性
    1. binaryType
    2. bufferedAmount
    3. extensions
    4. onclose
    5. onerror
    6. onmessage
    7. onopen
    8. protocol
    9. readyState
    10. url
  4. 方法
    1. close()
    2. send()
  5. Events
    1. close
    2. error
    3. message
    4. open
  6. 继承
    1. EventTarget
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

Mozilla

© 2005-2021 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies