HTML Web Worker and Jquery Ajax call

后端 未结 6 1215
夕颜
夕颜 2020-11-30 06:19

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

6条回答
  •  [愿得一人]
    2020-11-30 06:51

    The execution environment in Node.JS also lacks a native DOM implementation. I think it's fair to say that Node.JS and HTML5 Web Workers share certain restrictions.

    There are ways to simulate a DOM implementation for the purpose of using jQuery in Node.JS. If you still want to use jQuery in Web Workers, I think you should search for the Node.JS solutions and see if they apply.

提交回复
热议问题