我的网页由2 frame
s组成,其中name
和id
属性设置为“左”和“中”。从兄弟框架中找到包含iframe的框架
我运行在左一个JS脚本能够定位/在中央框架识别iframe
与name
和id
“monfrm”。
这里是JavaScript我到目前为止:
x = top.document.getElementById("center");
alert(x.src); //fine
// ok up to here
y = x.getElementById("monfrm"); // attempting to locate my iframe within "center" frame & that's where it hurts
alert("left says" + y.width); //eeh nothing
我可能老了COS'似乎容易得可怜,除非我错过了点.... :-)
任何光棚欢迎
感谢
是'width'有效的HTML元素属性?也许尝试'offsetWidth'可以解决你的问题。 – Federico
看在控制台上。你会有一个关于getElementById的错误 –