试图理解js中窗口和文档对象之间的区别 [英] trying to understand the difference between window and document objects in js
问题描述
我试图理解js中窗口和文档对象之间的区别。我在网上查了一下,但我还是没有清楚的了解。据我所知:窗口就像一个超级文档,它包含了文档对象。所以,如果我使用firefox打开一个页面:localhost / test.js,我可以说浏览器:firefox是window对象,文件test.js是文档对象吗?
I am trying to understand the difference between window and document objects in js. I checked online, but I still don't have a clear understanding. From what I know: window is like a super document, it includes the document object. So if I use firefox to open one page: localhost/test.js, can I say the browser:firefox is window object, and the file test.js is the document object?
推荐答案
一个非常详细的解释:在这里阅读
A very detailed explanation: Read here
基本上,窗口是浏览器的窗口,文档是其中的HTML页面。
Basically window is your browser's window and document is the HTML page inside it.
这篇关于试图理解js中窗口和文档对象之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!