I have this function that that I invoke onload:
function InitAll(){
document.getElementById("div1").onmouseover = function(){Foo(event,this);};
document.getElementById("div1").onmouseout = function(){Foo(event,this);};
}
function Foo(e, handler){
document.getElementById("label1").innerHTML=e.type;
}
In IE it works and I get the right e.type, but in firefox it does not:
event is not defined
But if I set events statically,like:
<div id="div1" onmouseover="Foo(event,this);" onmouseout="Foo(event,this);" >
it works for both browsers.
What am I missing? some kind of closure?