什么是全局长度变量(window.length)? [英] What is the global length variable (window.length)?
问题描述
我刚观察到每个页面都有长度
全局变量。
I have just observed that every page has length
global variable.
这个变量代表什么?它是否以某种方式与页面上加载了多少iframe /帧有关?
What does this variable represent? Is it somehow related to how many iframes/frames are loaded on page?
如果提供了文档参考,那就很高兴。
It'd be happy if a doc reference is provided.
例如,在Chrome新标签页上,其值为 17
,此处,在StackOverflow上,它是 0
。
For example, on Chrome new tab page its value is 17
and here, on StackOverflow it is 0
.
推荐答案
是的,这是多少帧(包括iframe)在当前窗口中:
Yes, it's how many frames (including iframes) are in the current window:
https://developer.mozilla.org/en-US/docs/Web/API/Window.length
W3规范:
http ://www.w3.org/html/wg/drafts/html/master/browsers.html#accessing-other-browsing-contexts
这篇关于什么是全局长度变量(window.length)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!