Ett enkelt exempel:
<html>
<head>
<title>Img</title>
<script language="javascript" type="text/javascript">
function doOnLoad()
{
var i = new Image();
i.onload = function() { document.getElementById( "myImg" ).src = this.src; }
i.src = "hogupplost.gif";
}
</script>
</head>
<body onload="doOnLoad();">
<img id="myImg" src="lagupplost.gif">
</body>
</html>
