So what exactly goes on with this onmessage/postMessage paradigm?
那么这个onmessage/postMessage 范型到底说明了什么?
Control returns immediately from PostMessage and the message gets processed later.
控制会从PostMessage立即返回,该消息是后来才处理的。
The last line of Listing 1 shows how the Worker is initiated—by calling its postMessage function.
清单1中的最后一行展示如何通过调用Worker 的postMessage函数来启动它。
When you finish processing the data in the Worker script, you invoke the postMessage function to send data back to the main thread.
当您处理完Worker脚本中的数据时,调用postMessage函数将数据返回主线程。
postMessage() from HTML 5 specification will allow users to communicate across domains to allow for secure cross domain communications.
HMTL5规范中postMessage()将允许用户进行安全的跨域通讯。
To pass this data back, the postMessage function is called, which will invoke the onmessage callback function on the worker, as shown back in Listing 9.
为了将此数据传递回去,调用了 postMessage函数,由该函数在这个worker上调用onmessage回调函数,如清单 9中所示。
To pass this data back, the postMessage function is called, which will invoke the onmessage callback function on the worker, as shown back in Listing 9.
为了将此数据传递回去,调用了 postMessage函数,由该函数在这个worker上调用onmessage回调函数,如清单 9中所示。
应用推荐