--- title: WebSocket.url slug: Web/API/WebSocket/url tags: - API - Property - Refrence - Web API - WebSocket translation_of: Web/API/WebSocket/url ---
{{APIRef("Web Sockets API")}}
The WebSocket.url
read-only property returns the absolute URL of the {{domxref("WebSocket")}} as resolved by the constructor.
WebSocket.url
是一个只读属性,返回值为当构造函数创建{{domxref("WebSocket")}}实例对象时URL的绝对路径。
var url = aWebSocket.url;
A DOMString
.
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', '#dom-websocket-url', 'WebSocket: url')}} | {{Spec2('HTML WHATWG')}} | Initial definition |
{{Compat("api.WebSocket.url")}}