Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有解决方案以在初始化后不使用 DOM 但具有兼容接口的方式实现对象window?document它们对于在 web worker 中使用像 MathJax 这样的重量级库很有用。
window
document
有一些方法可以在 worker 中进行 DOM 操作:
这可能看起来很傻,但您只需将“DOM 相关函数”的参数发送到浏览器并将结果返回给您的工作人员;