Look at the following code:
The "obj.onload =" contruct should override the first onload statement. In Firefox it works fine and when I click the button a "yes" message is shown. But in Internet Explorer the "no" message is shown. My problem is that I need to set the function (anonmymous) that should be called by the brower when iframe.onload and I can't get this to workin in IE. Can anyone help?
Thanks!
/Niels
Code:
<html>
<head>
</head>
<body>
<iframe id="olaf" name="olaf" onload="alert('no');"></iframe><br>
<input type="submit" onclick="document.getElementById('olaf').src = 'phpinfo.php'" value="Test">
</body>
<script language="javascript">
var obj = document.getElementById('olaf');
obj.onload = function() { alert('yes'); }
</script>
</html>
Thanks!
/Niels
Comment