We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3c5b8c commit 8b49a1eCopy full SHA for 8b49a1e
readme.md
@@ -1005,3 +1005,20 @@ oldnode.parentNode.replaceChild(clone, oldNode);
1005
* can reduce the number of event listeners by attaching one only to the parent
1006
* event properties can be used to filter out the events we care about
1007
* drawback: slightly more complex code but there are JS libraries to make this easy
1008
+
1009
+### web workers
1010
1011
+* javascript runs on a single thread in the browser
1012
+* web workers: background thread support by the browser
1013
+* only in modern browsers
1014
+* you put worker code in a separate file
1015
+* worker can use ```postMessage``` to send messages to the caller
1016
+* caller can subscribe to messages using ```Worker.onMessage```
1017
1018
+```js
1019
+var worker = new Worker('my_worker.js');
1020
+worker.onMessage(function(event) {
1021
+ console.log(event.data);
1022
+});
1023
+//my_worker.js: postMessage('hello there');
1024
+```
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments