四个工具:

  1. nodejs + npm
  2. npm安装的jsdom
  3. npm安装的jquery
  4. npm安装的browserify

网址:

browserify: https://browserify.org/

jsdom: https://github.com/jsdom/jsdom/

安装:

npm install -g jsdom
npm install -g jquery
npm install -g browserify

代码(main.js):

const { JSDOM } = require("jsdom");
const { window } = new JSDOM("");
const document = window.document;
let $ = require("jquery")(window);
globalThis.window = window;
globalThis.document = document;
globalThis["$"] = $;
不带jquery的

```
const { JSDOM } = require("jsdom");
const { window } = new JSDOM("");
const document = window.document;
globalThis.window = window;
globalThis.document = document;
```

编译(算是?):

browserify main.js -o wdj.js

我起的名字是简写(Window Document Jquery)

让worker引入wdj.js

importScripts("wdj.js");

实际效果:

第一次写这么简洁的博文,原因是三天考完期末,有点累

哦吼吼,能看到这个链接就说明我的文章被爬虫爬了

请尊重原作者: https://www.cnblogs.com/dffxd/

最新文章

  1. MySQL,排序,统计行转列
  2. who
  3. UVa 10387- Billiard
  4. 苹果系列机型专业刷机,解锁,解ID
  5. HDU 5775 Bubble Sort (线段树)
  6. 实现c++的string的split功能
  7. bzoj 2401: 陶陶的难题I 数论
  8. 【清橙A1084】【FFT】快速傅里叶变换
  9. linux中VI编辑器使用个人记录
  10. 【C#网络基础】C# get post请求
  11. iOS ARC注释和错误的解决方法在使用
  12. frontend http 前端名字定义问题
  13. CNS的数据库搜索网站可用solr实现
  14. Sencha Cmd的简介
  15. 关于Docker中的Images与Containers
  16. Failed to call ScheduleShutdown in logind, proceeding with immediate shutdown: Access denied
  17. 十四、Spring Boot 日志记录 SLF4J
  18. 砝码组合(dfs)
  19. pilicat-dfs 霹雳猫-分布式文件系统
  20. SQL server 基本语法

热门文章

  1. 【分析笔记】LVGL v8.2.0 使用 freetype 概率性无显示的问题
  2. 找了几个 Solon 的商业落地项目案例!
  3. Redis 异步客户端选型及落地实践
  4. 1月9日内容总结——linux相关知识简介、虚拟化软件vmware、远程链接工具xshell
  5. 笔记: C#RabbitMQ初步使用记录
  6. 好用的liunx可视化管理工具
  7. RabbitMQ基础和解疑
  8. Epicor 助力F1车队Scuderia AlphaTauri 提升车队运营效率和性能
  9. day09-MyBatis缓存
  10. VM中centos7创建后无法上网问题