BroadcastChannel()
BroadcastChannel()
コンストラクタは新しい BroadcastChannel
を作成し、それを基礎となるチャネルに接続します。
注: この機能は Web Worker 内で利用可能です
構文
channel = new BroadcastChannel(channel);
値
例
// "internal_notification" チャンネルをリッスンする新しいチャンネルを作成します。
var bc = new BroadcastChannel('internal_notification');
bc.postMessage('New listening connected!');
仕様
仕様 | 状態 | コメント |
---|---|---|
HTML Living Standard BroadcastChannel() の定義 |
現行の標準 | 初期定義 |
ブラウザーの互換性
BCD tables only load in the browser
関連情報
BroadcastChannel
: これが属するインターフェース。