Dette virker fint hos mig:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
window.onload = function() {
var target=document.getElementById("target"),num=Math.random()*4;
if (Math.round(num)==4) {
target.innerHTML+='<td style="position:relative;top:0px;left:0px;z-index: 10;"><div id="skjulDiv"><div style="position:absolute;margin-top:7px;margin-left:425px;"><img border="0" src="images/front/top4.jpg"></div><div style="position:absolute;margin-top:132px;margin-left:0px;"><img border="0" src="images/front/main4.jpg"></div><div style="position:absolute;margin-top:225px;margin-left:-219px;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="500" HEIGHT="50"><PARAM NAME=movie VALUE="images/flash/frise.swf"><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=best><PARAM NAME=wmode VALUE=transparent><EMBED SRC="images/flash/frise.swf" MENU=false QUALITY=best WIDTH="500" HEIGHT="50" WMODE=transparent TYPE="application/x-shockwave-flash" PLUGINSPAGE="
http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></div></div></td>'; } else {
target.innerHTML+='<td style="position:relative;top:0px;left:0px;z-index: 10;"><div id="skjulDiv"><div style="position:absolute;margin-top:7px;margin-left:474px;"><img border="0" src="images/front/top' + num + '.jpg"></div><div style="position:absolute;margin-top:132px;margin-left:0px;"><img border="0" src="images/front/main' + num + '.jpg"></div><div style="position:absolute;margin-top:225px;margin-left:-219px;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="500" HEIGHT="50"><PARAM NAME=movie VALUE="images/flash/frise.swf"><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=best><PARAM NAME=wmode VALUE=transparent><EMBED SRC="images/flash/frise.swf" MENU=false QUALITY=best WIDTH="500" HEIGHT="50" WMODE=transparent TYPE="application/x-shockwave-flash" PLUGINSPAGE="
http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></div></div></td>'; }
}
</script>
</head>
<body>
<button onclick="alert(document.body.innerHTML)">Kilde</button>
<div id="target">
<table border="1" cellspacing="0" cellpadding="0">
<tr id="target"></tr>
</table></div>
</body>
</html>
Læg mærke til at jeg wrapper en div med samme id som target udenom tabellen. Uden dette giver IE runtime error. Firefox, Opera etc behøver den ikke.