I\'m wondering if I can use jQuery inside the web worker file. Google Chrome gives me this error: \"Uncaught ReferenceError: $ is not defined\".
Here is the code: Th
Since web workers are in external files, they do not have access to the following JavaScript objects:
So you can't use $ inside worker file. Better you can use traditional AJAX something like this
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{
// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
Reference at http://www.w3schools.com/html/html5_webworkers.asp