Window和Window之间有什么区别? [英] What is the difference between Window and window?

查看:230
本文介绍了Window和Window之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是窗口

以下是Chrome中控制台上看到的内容:

Here's what I see on the console in Chrome :

    window
    Window {top: Window, window: Window, location: Location, external: Object, 
chrome: Object…}

    Window
    function Window() { [native code] }


推荐答案

窗口 是一个功能,你可以看到。它是Windows的构造函数(但是您不能直接用构造函数构建新窗口,通常使用 Window.open 功能)。 Window.prototype 因此保存您可以在窗口中调用的方法。)

Window is a function, as you can see. It's the constructor for the windows (but you can't build new windows directly with the constructor, you usually use the Window.open function). Window.prototype thus holds the methods you can call on the window).

窗口是包含 Window 的实例的全局变量,它表示包含您的文档的浏览器窗口(通常不是真正的窗口),而是一个选项卡在现代浏览器中)

window is the global variable holding an instance of Window, it represents the browser window containing your document (not really a "window" usually, rather a tab in modern browsers).

您可以查看

window instanceof Window

true

这篇关于Window和Window之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆