withCredentials
只读特性在
EventSource
interface returns a
布尔
indicating whether the
EventSource
object was instantiated with CORS credentials set.
var myWithCredentials = eventSource.withCredentials;
A
布尔
indicating whether the
EventSource
object was instantiated with CORS credentials set (
true
), or not (
false
,默认)。
var evtSource = new EventSource('sse.php');
console.log(evtSource.withCredentials);
注意 : You can find a full example on GitHub — see Simple SSE demo using PHP.
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of 'withCredentials' in that specification. |
实时标准 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
withCredentials
|
Chrome 6 | Edge 79 | Firefox 6 | IE 不支持 No | Opera Yes | Safari 5 | WebView Android Yes | Chrome Android 18 | Firefox Android 45 | Opera Android 12 | Safari iOS 5 | Samsung Internet Android 1.0 |
完整支持
不支持
EventSource
onerror
onmessage
onopen
readyState
url
withCredentials