This code runs fine in Safari and Mozilla and gives me an error in IE (story of my life). The image loads, triggers the loaded functionm the alert comes up, but afterwards it says error: "Not Implemented" for the line of the body's onload command. Any help on this? This is not my real code, just simplified to isolate the problem. Basically I want to run a function when an image is done loading. Like a slideshow, after a transparent image is loaded, a transition is called to show it. Thanks.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Untitled Page</title>
<script>
function loaded() {
alert('Loaded');
}
</script>
</head>
<body bgcolor="#ffffff" onload="document.getElementById('daImg').onload = loaded();">
<img src="http://images.motogp.com/multimedia2/396/396109_50572.jpg" id="daImg">
</body>
</html>
|