<script>
function f()
{
var img = document.createElement("img");
// fox 用
img.src = "1.gif";
img.onload = function(){alert(s);img.parentNode.removeChild(img);};
// ie 用
img.src = "wrong";
img.onerror = function(){alert(s);img.parentNode.removeChild(img);};
document.body.appendChild(img);
}
function f2()
{
s="now define s";
}
</script>
<body οnlοad="f();f2();"></body>
function f()
{
var img = document.createElement("img");
// fox 用
img.src = "1.gif";
img.onload = function(){alert(s);img.parentNode.removeChild(img);};
// ie 用
img.src = "wrong";
img.onerror = function(){alert(s);img.parentNode.removeChild(img);};
document.body.appendChild(img);
}
function f2()
{
s="now define s";
}
</script>
<body οnlοad="f();f2();"></body>