I have a page with an Iframe. I am using the following code to get the size of Iframe:
<script language="javascript">
function sn()
{
alert('height is now '+document.getElementById("Iframemain").height)
alert('height is now '+document.getElementById("Iframemain").width)
}
</script>
<input type="button" onClick="sn()" value="Show height/width">
I have also another page with an Iframe but i do not know the id of the Iframe. I want to know the size the of the Iframe using javascript. How can i do it?
thanx in advance .
Thanx Rory McCrossan i have also tried that following code but getting udefined in alert msg.
<script language="javascript"> function sn()
{
var frame = window.frames[0];
alert(frame.width)
alert(frame.height)
}
</script>
<input type="button" onClick="sn()" value="Show height/width">
</html>