Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should be able to use the ideas from <a href="http://www.html5gamedev.de/2013/07/19/a-start-on-multi-threading-using-web-workers/" rel="nofollow noreferrer">this method</a>, which uses a <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob" rel="nofollow noreferrer">Blob</a> to give the web worker access to the originating dom.</p> <p><strong>Update</strong></p> <p><strike>The worker does indeed have access to the <code>DOM</code>, as <a href="http://jsfiddle.net/unKCK/" rel="nofollow noreferrer">this</a> toy example should demonstrate</strike>.</p> <p>the above statement is a blatant lie (thanks OP). See Update II</p> <p><strong>Update II</strong></p> <p>as the OP correctly has pointed out in the comments below, the example given is cheating. If you are able to liberate yourself from JQuery, I have an example using the quite capable <a href="http://xmljs.sourceforge.net/" rel="nofollow noreferrer">xml for &lt;script&gt;</a> library to do some SAX processing on an xml document. I have posted the example to <a href="https://github.com/manniche/js-webworkers" rel="nofollow noreferrer">github</a>. When executed, the result is written to the <code>console</code>, so have one open. </p> <p>I have uploaded the code <a href="http://things.manniche.net/" rel="nofollow noreferrer">here</a> for demo purposes.</p> <p>Also, a good in-depth discussion of web workers and inaccessibility of the DOM is provided in <a href="https://stackoverflow.com/q/18056922/1448983">this SO question</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload