窗口对象的节点。js交互式shell

时间:2022-02-03 08:58:33

I installed the node.js v6.9.1 and typed window but received only an error. In the Chrome js console, window prints "window" and if you click on the triangular link you can see all the window.whatever functions. How do I get that same result using the node shell?

我安装的节点。并输入窗口,但只收到一个错误。在Chrome js控制台,窗口打印“窗口”,如果你点击三角形链接,你可以看到所有窗口。任何功能。如何使用节点shell获得相同的结果?

Thanks.

谢谢。

1 个解决方案

#1


3  

You can't. There is no window in Node. Window is part of the browser which is totally absent in Node.

你不能。节点中没有窗口。窗口是浏览器的一部分,在Node中是完全不存在的。

The Node Shell is referred to as the REPL

节点Shell被称为REPL

Window (from MDN)

The window object represents a window containing a DOM document; the document property points to the DOM document loaded in that window.

窗口对象表示包含DOM文档的窗口;document属性指向在该窗口中加载的DOM文档。

#1


3  

You can't. There is no window in Node. Window is part of the browser which is totally absent in Node.

你不能。节点中没有窗口。窗口是浏览器的一部分,在Node中是完全不存在的。

The Node Shell is referred to as the REPL

节点Shell被称为REPL

Window (from MDN)

The window object represents a window containing a DOM document; the document property points to the DOM document loaded in that window.

窗口对象表示包含DOM文档的窗口;document属性指向在该窗口中加载的DOM文档。