PDA

View Full Version : How to copy an iframe to another place?


Kakao
03-09-2008, 03:03 AM
I want to copy (not move) an iframe from one table cell to another. I have been trying but can't get it. Any hints would be appreciated.

Kakao
03-09-2008, 07:31 PM
This is what I came up with:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<head>
<title><!-- Insert your title here --></title>
<script type="text/javascript">
function copy_iframe() {
copy_to = document.getElementById('cell_2');
copy_from = document.getElementById('cell_1');
copy_to.appendChild(copy_from.cloneNode(true));
}
</script>
</head>
<body onload="copy_iframe();">

<table border="1">
<tr>
<td id="cell_1">
<iframe src="./frame_document.html"></iframe>
</td>
<tr>
<td id="cell_2">
</td>
</tr>
</table>

</body>
</html>