//在其中一个frame里操作主窗口
var ff=window.parent.window.document.getElementsByTagName("frameset");
var colsValue=ff['menuframe'].getAttribute('cols');
//获得iframe对象
var ff=document.getElementById('iframeOne');
//获得iframe上的document对象
ff.contentWindow.document.getElementById('oneElement');
var ff=window.parent.window.document.getElementsByTagName("frameset");
var colsValue=ff['menuframe'].getAttribute('cols');
//获得iframe对象
var ff=document.getElementById('iframeOne');
//获得iframe上的document对象
ff.contentWindow.document.getElementById('oneElement');
本文介绍了一种在特定框架中操作主窗口的方法,通过JavaScript获取主窗口的属性和iframe元素。包括如何使用`window.parent.window.document`来访问顶层窗口的文档对象模型(DOM),以及如何通过ID选择器获取指定的iframe。
206

被折叠的 条评论
为什么被折叠?



