183
rated 0 times
[
185]
[
2]
/ answers: 1 / hits: 48285
/ 12 Years ago, wed, june 27, 2012, 12:00:00
I am using this Web worker which has a Global variable declared in it. Can I access the same (Global variable in worker 1) in the newly spawned web worker(worker 2)?
When I've tried using jQuery in web worker, I get error "window is not defined". Is there any way to use jQuery in a Web Worker
?
importScripts('jquery-latest.js');
function fetch_ajax(url) {
$.ajax({
type: 'GET',
url: url,
success: function(response) {
postMessage(response);
}
});
}
fetch_ajax('test.txt');
More From » web-worker