Closed marclar closed 9 years ago
A web worker is a pure JS environment (no DOM) and XDomain relies on a iframes (DOM). If you need to perform an XDomain proxied request through a web worker, then I think your best option is define an RPC-like function back to the host page, where it does something like:
//this is psuedo-code
worker.on("message", function(e) {
var data = e.data;
if(data.ajax) {
$.ajax(data.ajax).always(function(results) {
worker.send({ id, data.id, ajax: results });
});
}
});
Hi there !
Many thanx for your API !!!
I'm stuck though with this worker problem.
Could you please elaborate on this RPC-like approach ?
Cheers,
I assume it's not because it seems to rely on iframes / the DOM. Is that correct?