--- title: window.length slug: Web/API/Window/length translation_of: Web/API/Window/length ---
返回当前窗口中包含的框架数量(框架包括frame和iframe两种元素).
frame
iframe
framesCount = window.length;
framesCount
if (window.length) { // 该窗口包含至少一个子框架 }
{{DOM0}}