Accessing an IFrame's properties
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Accessing an IFrame's properties

From: Aaron Gray <ang.usenet@gmail.com>
Date: Wed Apr 05 2006 - 01:55:00 CEST

Hi,

I want to access the properties of an IFrame but seem unable to get access
to the IFrames document body.

<html>

<body>
    <iframe src="test.html" id="IFrame"></iframe>
</body>

<script>
    var f = document.getElementById('IFrame');
    f.document.body.innerHTML = "This is another test";
</script>

</html>

This writes to the main document not the IFrame.

I am doing something very basic wrong but cannot work out what. (I do know I
should be doing a open/write/close rather than an innerHTML but this is just
for testing access to the contained IFrames properties)

Help,

Aaron
Received on Mon May 1 04:41:45 2006