Note that there are some explanatory texts on larger screens.

plurals
  1. PO'Uncaught Error: DATA_CLONE_ERR: DOM Exception 25' thrown by web worker
    text
    copied!<p>So I'm creating a web worker:</p> <pre><code>var arrayit = function(obj) { return Array.prototype.slice.call(obj); }; work = arrayit(images); console.log(work); //work = images.push.apply( images, array ); // Method : "load+scroll" var worker = new Worker('jail_worker.js'); worker.postMessage(work) worker.onmessage = function(event) { console.log("Worker said:" + event.data); }; </code></pre> <p>Here's what images is:</p> <pre><code>$.jail.initialStack = this; // Store the selector into 'triggerEl' data for the images selected this.data('triggerEl', (options.selector) ? $(options.selector) : $window); var images = this; </code></pre> <p>I think my problem has something to do with this:</p> <p><a href="http://dev.w3.org/html5/spec/Overview.html#safe-passing-of-structured-data">http://dev.w3.org/html5/spec/Overview.html#safe-passing-of-structured-data</a></p> <p>How can I get around this? as you can see, I tried slicing the host object into a real array, but that didn't work.</p> <p>Here's a link to the file I'm hacking on:</p> <p><a href="https://github.com/jtmkrueger/JAIL">https://github.com/jtmkrueger/JAIL</a></p> <p>UPDATE--------------------------------------------------</p> <p>This is what I had to do based on the accepted answer from @davin: </p> <pre><code>var arrayit = function(obj) { return Array.prototype.slice.call(obj); }; imgArray = arrayit(images); work = _.map(images, function(i){ return i.attributes[0].ownerElement.outerHTML; }); var worker = new Worker('jail_worker.js'); worker.postMessage(work) worker.onmessage = function(event) { console.log("Worker said:" + event.data); }; </code></pre> <p>NOTE: I used underscore.js to assure compatibility.</p>
 

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