broadcast channel mdn
// Connection to a broadcast channel
const bc = new BroadcastChannel('test_channel');
4
9
// Example of sending of a very simple message
bc.postMessage('This is a test message.');
Thank you!
9
0
4.5
2
// A handler that only logs the event to the console:
bc.onmessage = function (ev) { console.log(ev); }
Thank you!
2
0
Are there any code examples left?
New code examples in category Javascript