我的網頁由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的錯誤 –