V8 shell 中的 DOM API
我已经从独立的 Google V8 javascript 引擎编译了 SHELL 来运行 javascript。它工作得很好,直到我给出一个包含 DOM API 的 javascript。对于 DOM API,它会给出语法错误。是否应该包含任何库才能使其正常工作?
I have compiled SHELL from standalone Google's V8 javascript engine to run javascript. It works fine until I give a javascript that has DOM API in it. With DOM APIs it gives syntax error. Is there any library that should be included to get this worked?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
独立 shell 没有 DOM(文档对象模型),因为它不在提供文档和 DOM 实现的浏览器中运行。
如果您只想尝试一些 DOM 代码,您也许可以使用 https://github.com /Raynos/DOM-shim 模拟 DOM。显然,您不会拥有真正的页面,并且它在任何地方都不会可见,但它可能适用于测试目的。
The stand-alone shell doesn't have the DOM (Document Object Model), since it's not running in a browser that provides the document and DOM implementation.
If you just want to try some DOM code, you might be able to use something like https://github.com/Raynos/DOM-shim to simulate a DOM. You obviously won't have a real page and it won't be visible anywhere, but it might work for testing purposes.