zackwiny
08-06-2008, 11:21 PM
Here is my code:
<html>
<head>
<SCRIPT>
function showFrameText()
{
d = document.getElementById("iframeholder");
k = d.contentWindow.document.getElementById("table1").innerHTML;
return k;
}
function init()
{
var innerstuff = '<table>' + showFrameText() + '</table>';
alert(innerstuff);
document.write(innerstuff);
}
</SCRIPT>
</head>
<body>
<iframe onload="init()" src="index2.html" id="iframeholder" name="iframeholder">if you see this you have iframes turned off.</iframe>
</body>
</html>
Here is index2.html's code:
<table id="table1" border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
The problem is that the innerstuff variable is blank for the document.write command but not for the alert command,
i need help making it work,
Thanks
<html>
<head>
<SCRIPT>
function showFrameText()
{
d = document.getElementById("iframeholder");
k = d.contentWindow.document.getElementById("table1").innerHTML;
return k;
}
function init()
{
var innerstuff = '<table>' + showFrameText() + '</table>';
alert(innerstuff);
document.write(innerstuff);
}
</SCRIPT>
</head>
<body>
<iframe onload="init()" src="index2.html" id="iframeholder" name="iframeholder">if you see this you have iframes turned off.</iframe>
</body>
</html>
Here is index2.html's code:
<table id="table1" border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
The problem is that the innerstuff variable is blank for the document.write command but not for the alert command,
i need help making it work,
Thanks