You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
postMessage('halfway there, `tmp` is now ' + tmp);
336
336
}
337
337
}
338
338
339
339
postMessage('all done');
340
340
341
-
web worker使用postMessage()来和调用它的程序通讯,调用者通过onmessage事件来接受更新。onmessage事件处理函数接受一个事件对象作为参数,这个对象含有一个由web worker传过来data属性。类似的,调用者(在这个例子中)也可以使用ww.postMessage()来给web worker传递数据,web worker可以通过一个onmessage事件处理函数来接受这些数据。
341
+
web worker使用`postMessage()`来和调用它的程序通讯,调用者通过`onmessage`事件来接受更新。`onmessage`事件处理函数接受一个事件对象作为参数,这个对象含有一个由web worker传过来`data`属性。类似的,调用者(在这个例子中)也可以使用`ww.postMessage()`来给web worker传递数据,web worker可以通过一个`onmessage`事件处理函数来接受这些数据。
0 commit comments