Skip to main content
100%

Gist 164876

✓ Published0🌍 Public
XXXX
Last edited Aug 9, 2009
Created on Aug 9, 2009

This example demonstrates a minimal two-way communication setup between a main HTML page and a background worker thread, using the `Worker` API to offload a request. The worker script `my_worker.js` uses `XMLHttpRequest` to fetch `http://www.google.com/` and posts the response text back to the main page via `postMessage`, which is displayed through an `alert`. The code shows the basic pattern of instantiating a `Worker`, assigning an `onmessage` handler, and triggering an asynchronous request, but it does not include any data visualization or rendering.

AI-generated description

Similar vizzes