Gør jeg noget forkert, der sker ikke noget...
Jeg har to filer, den ene hedder test.html, og ser således ud:
--------------------------------------
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> new document </title>
</head>
<body>
<iframe id="iframe11" src ="billede.html"></iframe>
</body>
</html>
--------------------------------------
den anden hedder billede.html, og ser således ud:
--------------------------------------
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> new document </title>
<script language="javascript">
function loadimage(url)
{
document.frames['iframe11'].document.getelementbyid('img11').src = url;
document.getelementbyid('iframe11').onreadystatechange = onreadystatechange;
}
function onreadystatechange()
{
alert(event.srcelement.readystate);
if(event.srcelement.readystate=='complete')
resizecontainer();
}
function resizecontainer()
{
var iframe = document.getelementbyid('iframe11');
var image = document.frames['iframe11'].document.getelementbyid('img11');
iframe.style.height = image.style.clientheight;
iframe.style.width = image.width;
}
</script>
</head>
<body onload="loadimage('
http://www.overclocking.dk/img/users/11648_01.jpg')">
<img src ="
http://www.overclocking.dk/img/users/11648_01.jpg" id="img11" />
</body>
</html>
--------------------------------------
er det rigtigt?